Dear Statalisters,
I am trying to access confidence intervals from nlcom to be able to make a graph, however I cannot figure out how to do that. nlcom stores the transformed coefficients and the estimated variance-covariance matrix in r(), but not the confidence intervals. Is there any way to access them or to calculate them? esttab (from the Stata Journal) is able to do it but I don't know how. I know I can also use margins but I'm using nlcom because it allows to estimate multiple expressions at the same time.
I am trying to access confidence intervals from nlcom to be able to make a graph, however I cannot figure out how to do that. nlcom stores the transformed coefficients and the estimated variance-covariance matrix in r(), but not the confidence intervals. Is there any way to access them or to calculate them? esttab (from the Stata Journal) is able to do it but I don't know how. I know I can also use margins but I'm using nlcom because it allows to estimate multiple expressions at the same time.
Code:
. webuse grunfeld, clear
. qui xtreg invest L(0/2).mvalue, fe
. nlcom (_b[mvalue]) ///
> (_b[mvalue] + _b[L.mvalue]) ///
> (_b[mvalue] + _b[L.mvalue] + _b[L2.mvalue]), post
_nl_1: _b[mvalue]
_nl_2: _b[mvalue] + _b[L.mvalue]
_nl_3: _b[mvalue] + _b[L.mvalue] + _b[L2.mvalue]
------------------------------------------------------------------------------
invest | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_nl_1 | .1713403 .0205473 8.34 0.000 .1310683 .2116123
_nl_2 | .242995 .0236924 10.26 0.000 .1965588 .2894312
_nl_3 | .2848838 .0311509 9.15 0.000 .2238292 .3459384
------------------------------------------------------------------------------
. esttab, ci
--------------------------------------
(1)
invest
--------------------------------------
_nl_1 0.171***
[0.131,0.212]
_nl_2 0.243***
[0.197,0.289]
_nl_3 0.285***
[0.224,0.346]
--------------------------------------
N 180
--------------------------------------
95% confidence intervals in brackets
* p<0.05, ** p<0.01, *** p<0.001

Comment