Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: obtaining confidence interval from -lincom-

From   "Roger B. Newson" <>
Subject   Re: st: obtaining confidence interval from -lincom-
Date   Sun, 26 May 2013 15:01:13 +0100

Another possibility is to use the -lincomest- package (downloadable from SSC) to store the -lincom- results as estimation results, and then to use the -parmest- package (also downloadable from SSC) to list and/or store a dataset of confidence intervals. See Section 3.3 of Newson (2003).

I hope this helps.

Best wishes



Newson R. Confidence intervals and p-values for delivery to the end user. The Stata Journal 2003; 3(3): 245-269. Download from

Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

On 25/05/2013 14:59, Federico Belotti wrote:

you can easily put -lincom- confidence interval into scalars using

scalar ci_lb = r(estimate) + invnorm(0.025)*r(se)

scalar ci_ub = r(estimate) + invnorm(0.975)*r(se)

scalar list

if the sample is small you could substitute invnormal() with invttail()


Il giorno 25/mag/2013, alle ore 15:04, Tom <> ha scritto:

Dear list,

My research supervisor told me that I can generate a marginal effects
plot much like the one on page 14 of Brambor et al. (2006). [1]

Note that using marginsplot in Stata 12 does not create such plot.
Therefore my supervisor told me to  do the following:

## code start ##

* regress *
reg g ipr dtflog dtflogipr i.cid, robust

cap drop l_dtf
cap drop l_est
gen l_dtflog = .
gen l_est = .

* lincom *
forval i = 1/61 {
    local dtflog = (`i'-1) / 10

    lincom _b[ipr] + `dtflog' * _b[dtflogipr], level(95)

    * save *
    replace l_dtflog = `dtflog' in `i'
    replace l_est = r(estimate) in `i'


line l_est l_dtflog

## code end ##

In short: the regression has two main independent variables ipr and
dtflog and one interaction term of these two variables (dtflogipr).
dtflog ranges from 0 to 6 and is looped through to see the interaction
effect for certain values of dtflog.

I want to make the same graph as Brambor et al. (2006), where both
confidence interval borders being above or below the horizontal axis
indicates a singificant interaction effect.

The only problem so far seems to be that while lincom returns a
confidence interval, when I do -return list- I only see the estimate
in r(estimate), but I cannot retrieve the confidence interval from the

So, how would I retrieve the confidence interval listed in the table
after running -lincom- ?


[1]: Brambor, Thomas, William Roberts Clark, and Matt Golder.
"Understanding interaction models: Improving empirical analyses."
Political analysis 14.1 (2006): 63-82.
Available from
*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index