help for bmjcip                                                  (Roger Newson)

Format confidence intervals and P-values for medical journals

bmjcip estvarname ciminvarname cimaxvarname [ pvarname ] [ , cformat(%fmt) ]

where estvarname, ciminvarname, cimaxvarname and pvarname are numeric variable names, and %fmt is a numeric display format.


bmjcip reformats a list of numeric variables, containing estimates, confidence limits and (optionally) P-values, to string variables, containing the same values formatted for presentation in medical journals. The new string variables replace the old numeric variables, and have the same names, variable labels, and positions in the dataset. bmjcip is usually used in output datasets (or resultssets) produced by the parmest package, and the reformatted string variables are later output using the listtex package for input to Microsoft Word. It requires the sdecode package in order to work. The sdecode, parmest and listtex packages can all be downloaded from SSC.


cformat(%fmt) specifies a display format, used for the estimates and confidence limits. However, bmjcip also adds parentheses and commas to the confidence limits, as expected by medical journals. The P-value is formatted using a separate rule, not corresponding exactly to any Stata display format. (See Remarks below.)


Guidelines for presentation of confidence intervals in medical journals is given in Altman et al. (2000). The name bmjcip was chosen because these guidelines were written originally for the British Medical Journal (BMJ) group of journals.

The presentation of P-values is still subject to some controversy, even among statisticians. However, bmjcip presents a P-value of 1 as 1.0, a P-value less than 1 and no less than .00001 as a left-justified decimal number with no zero before the decimal point, and a P-value below 0.00001 and greater than 0 in the format x.yx10-z (where x and y are digits and z is an integer), and a P-value of 0 as 0. Note that, if the P-values are output by listtex and converted into Microsoft Word tables, then the user must convert each "-z" to a superscript by hand.

If the user wishes to keep the original numeric variables, then the user may use clonevar to make new numeric variables that are copies of the original variables, and then reformat these to string variables using bmjcip.

bmjcip is not a satisfactory long-term solution to the problem of formatting confidence intervals and P-values. However, most medical sector scientists want to publish tables in the BMJ and other medical periodicals without waiting for such a solution.


. bmjcip estimate min95 max95 p

. bmjcip estimate min95 max95 p, cformat(%10.3f)

. bmjcip estimate min95 max95, cf(%10.1f)


Roger Newson, National Heart and Lung Institute, Imperial College London, UK. Email: r.newson@imperial.ac.uk


Altman, D. G., D. Machin, T. N Bryant and M. J Gardner. 2000. Statistics with Confidence. 2nd ed. London, UK: British Medical Journal.

Also see

Manual: [D] destring, [D] clonevar, [D] format On-line: help for tostring, destring, clonevar, format help for sdecode, parmest, listtex if installed