{smcl}
{hline}
help for {cmd:bmjcip}{right:(Roger Newson)}
{hline}

{title:Format confidence intervals and P-values for medical journals}

{p 8 21 2}
{cmd:bmjcip} {it:estvarname} {it:ciminvarname} {it:cimaxvarname} [ {it:pvarname} ] [ , {cmdab:cf:ormat(}{it:%fmt}{cmd:)} ]

{pstd}
where {it:estvarname}, {it:ciminvarname}, {it:cimaxvarname} and {it:pvarname} are numeric {help varname:variable names},
and {it:%fmt} is a numeric {help format:display format}.


{title:Description}

{pstd}
{cmd:bmjcip} reformats a list of numeric variables,
containing estimates, confidence limits and (optionally) {it: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.
{cmd:bmjcip} is usually used in output datasets (or resultssets) produced by the {helpb parmest} package,
and the reformatted string variables are later output using the {helpb listtex} package
for input to Microsoft Word.
It requires the {helpb sdecode} package in order to work.
The {helpb sdecode}, {helpb parmest} and {helpb listtex} packages can all be downloaded from {help ssc:SSC}.


{title:Options}

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


{title:Remarks}

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

{pstd}
The presentation of {it:P}-values is still subject to some controversy, even among statisticians.
However, {cmd:bmjcip} presents a {it:P}-value of 1 as 1.0,
a {it: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 {it:P}-value below 0.00001 and greater than 0 in the format {it:x.y}x10-{it:z}
(where {it:x} and {it:y} are digits and {it:z} is an integer),
and a {it:P}-value of 0 as 0.
Note that, if the {it:P}-values are output by {helpb listtex} and converted into Microsoft Word tables,
then the user must convert each "-{it:z}" to a superscript by hand.

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

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


{title:Examples}

{p 8 12 2}{cmd:. bmjcip estimate min95 max95 p}{p_end}

{p 8 12 2}{cmd:. bmjcip estimate min95 max95 p, cformat(%10.3f)}{p_end}

{p 8 12 2}{cmd:. bmjcip estimate min95 max95, cf(%10.1f)}{p_end}


{title:Author}

{pstd}
Roger Newson, National Heart and Lung Institute, Imperial College London, UK.{break}
Email: {browse "mailto:r.newson@imperial.ac.uk":r.newson@imperial.ac.uk}


{title:References}

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


{title:Also see}

{p 4 13 2}
{bind: }Manual: {hi:[D] destring}, {hi:[D] clonevar}, {hi:[D] format}
{p_end}
{p 4 13 2}
On-line: help for {helpb tostring}, {helpb destring}, {helpb clonevar}, {helpb format}{break}
         help for {helpb sdecode}, {helpb parmest}, {helpb listtex} if installed
{p_end}
