*! version 1.0.0 06may2019

Title

cifunction -- Computes and graphically displays all possible confidence intervals around a point estimate

Syntax

cifunction
#b
,
se(#)
[
df(#)
eform
figure[(twoway_options)]
saving(filename, replace)
]

#b can be specified as a coefficient or exponentiated value (e.g. OR, HR, IRR)

* se(#) specify the standard error of the estimate

df(#) specify the degrees of freedom if #b is t-distributed (e.g. when using regress to produce estimates)

eform indicate that the coefficient is exponentiated (e.g. OR, RR, IRR)

figure[(twoway_options)] produces a confidence interval function plot. Specifying figure
without options (or not specifying figure at all) uses the default graph settings

saving(filename, replace) save results to filename. The suboption "replace" is allowed

* se() must be specified.

Description

cifunction computes and plots the confidence interval function (Sullivan and Foster 1990) which is also referred to as the
confidence curve (Birnbaum 1961), P-value function (Poole 1987; Miettinen 1985; Rothman et al. 2008), and consonance interval (Folks 1981).
A CI-function is a graphical display of all possible CIs around a specified point estimate. The peak of the curve indicates the point estimate, and the
concentration of the curve around the point estimate indicates the precision of the estimate. A narrow CI-function would result from a large study with
high precision, and a broad CI-function would result from a small study that had low precision. CI functions convey much more of
the essential information by indicating the range of values that are reasonably compatible with the observations, assuming the statistical model is correct.
They can also show that the data do not contain the information necessary for reassurance about an absence of effect (Rothman et al. 2008).

cifunction is an immediate command, see immed.

Options

se(#) specifies the standard error of the estimate. se() is required.

df(#) specifies the degrees of freedom if #b is t-distributed (e.g. when using regress to compute estimates).

eform specifies that the coefficient is exponentiated (e.g. OR, RR, IRR)

figure[(twoway_options)] produces
a range plot, shading the area between the upper and lower CI limits. Specifying figure without options (or simply not specifying figure) uses the
default graph settings.

saving(filename, replace) specifies the filename where all the variables generated by cifunction will be saved. replace, used with
saving, specifies that filename can be replaced if it already exists.

Examples from Sullivan and Foster (1990)

Reproduce Figure 1.

First we use getregstats (downloadable from SSC) to get the standard error for a risk ratio of 2.0 with p-value of 0.05.

. getregstats 2.0, p(0.05) mod(rr)

We then use cifunction specifying the point estimate and std. error. We modify the figure to improve the presentation.

. cifunction 2.0, se(.707306) eform fig(xscale(log) xlab(0.5 1 2 5 10) xtitle("Risk Ratio (Log Scale)"))

Reproduce Figure 2.

Set-up

. webuse dollhill3, clear

. poisson deaths smokes if agecat==1, exposure(pyears) irr

. poisson deaths smokes if agecat==2, exposure(pyears) irr

. poisson deaths smokes if agecat==3, exposure(pyears) irr

. poisson deaths smokes if agecat==4, exposure(pyears) irr

We plug in these coefficients and std. errors into cifunction and further modify the figure.

. cifunction 5.736638 2.138812 1.46824 1.35606, se(4.181258 .6520701 .295728 .2748845) eform ///

fig(xscale(log) xlabel(.3 .5 1 2 5 10 20 50 100) legend(label(1 "35-44") label(2 "45-54") label(3 "55-64") label(4 "65-74") ///

title("Age Group", size(small))) xtitle("Rate Ratio (Log Scale)")))

(click to run)

Reproduce Figure 3.

Set-up, using cci on data from Mann et al (1976), then run getregstats to get std errors.

. cci 10 36 5 40, woolf

. cci 18 78 7 86, woolf

. getregstats 2.835165, ucl(7.151794) mod(or)

. getregstats 2.222222, ucl(7.118025) mod(or)

We then run cifunction using both estimates for crude and pooled.

. cifunction 2.222222 2.835165, se(1.319891 1.33843) eform ///

fig(xscale(log) xlabel(.2 .5 1 2 5 10 20) ///

legend(label(1 Crude) label(2 Pooled)) xtitle("Odds Ratio (Log Scale)")))

(click to run)

Reproduce Figure 4.

Set-up, using getregstats on data from from Table 5 (for Finland, New Orleans/Los Angeles, Denmark, and Upstate New York) in Gufferman et al (1984) to get std errors.

. getregstats 0.7, l(.2) mod(rr)

. getregstats 1.2, l(.8) mod(rr)

. getregstats 1.3, l(.5) mod(rr)

. getregstats 3.6, l(1.3) mod(rr)

We then run cifunction using all estimates.

cifunction .7 1.2 1.3 3.6, se(.4474236 .2482485 .6337692 1.870876) eform ///

fig(xscale(log) xlabel(.05 .1 .2 .5 1 2 5 10 30) ///

legend(label(1 "Finland") label(2 "NO/LA") label(3 "Denmark") ///

label(4 "Upstate NY")) xtitle("Relative Ratio (Log Scale)")))

(click to run)

Example Figure 10.5 from Rothman et al (2008)

Using getregstats to get std errors and produce Figure 10.5. Here we use the saving option as well.

. getregstats 0.87, l(0.70) model(or)

. getregstats 0.87, l(0.70) model(or)

cifunction 0.87 0.88, se(.0965065 .0658232) eform fig( xlab(.5(.1)1.3) xtitle("Odds Ratio") ///

legend(label(1 "Eisenberger et al (1998)") ///

label(2 "Summary of 10 studies") ring(0) position(11))) sav(figdata, replace)

(click to run)

Output table

cifunction produces and stores several variables when the saving() option is specified.
Below is a list of each variable in the saved file. Variables ending with an integer indicate
which estimates they belong to. When only one set of estimates is provided (i.e. point estimate and std. error),
the variables will be followed by 1.

Variable Description

cilev sequencing range of CIs (from 0 to 99.99)

plev sequencing range of P-values (from 0.0001 to 1.0)

sval S-values computed for respective plev values (see Greenland [2019])

lcl(#) computed lower confidence limits

ucl(#) computed upper confidence limits

Acknowledgments

I thank John Moran for advocating that I write this package as well as providing suggestions for improvement.

References

Birnbaum, A. 1961. Confidence curves: An omnibus technique for estimation and testing statistical hypotheses.
Journal of the American Statistical Association 56: 246-249.

Folks, J. F. 1981. Ideas of Statistics.
New York: John Wiley & Sons.

Greenland, S. 2019. Valid P-Values Behave Exactly as They Should:
Some Misleading Criticisms of P-Values and Their Resolution With S-Values.
The American Statistician 73(sup1): 106-114.

Gufferman, S., and E. Delzell. 1984. Epidemiology of Hodgkin's disease.
Epidemiology Review 6: 76-106.

Mann, J. I., Inman, W. H. W., and M. Thorogood. 1968. Oral contraceptive use in older women and fatal myocardial infarction.
British Medical Journal 2: 193-199.

Miettinen, O. S. 1985. Theoretical Epidemiology: Principles of Occurrence Research in Medicine.
New York: John Wiley & Sons.

Poole, C. 1987. Beyond the confidence interval.
American Journal of Public Health 77: 195-199.

Rothman, K. J., Greenland, S. and T. L. Lash. 2008. Modern epidemiology (Vol. 3).
Philadelphia: Wolters Kluwer Health/Lippincott Williams & Wilkins.

Sullivan, K.M. and D. A. Foster. 1990. Use of the confidence interval function.
Epidemiology 1: 39-42.

Citation of cifunction

cifunction is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden A. (2019). CIFUNCTION: Stata module for computing and graphically displaying all possible confidence intervals around a point estimate.
Statistical Software Components, Boston College Department of Economics.

Author

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: getregstats (if installed), niceloglabels (if installed)