Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Esta: possible to keep/inherit dummie-labels?


From   "Ben Jann" <[email protected]>
To   [email protected]
Subject   Re: st: Esta: possible to keep/inherit dummie-labels?
Date   Mon, 11 Jun 2007 10:56:10 +0200

First, note that -esta- and -esto- have been renamed. The new names
are -esttab- and -eststo-.

Second, note that the exponentiated coefficients can be tabulated
using the -eform- option. This also transforms the confidence
intervals.

Now the answer to the question: -esttab- will not be able to collect
the labels for the xi-dummies from the original variable. Therefore,
you'd have to label the xi-variables and use the -label- option in
-esttab-. Furthermore, the reference category can be included using
the -refcat()- option (documented in -help estout-). Here's an
example:

. sysuse cancer, clear
(Patient Survival in Drug Trial)

. quietly stset studytime, failure(died)

. eststo: xi: quietly stcox i.drug
i.drug            _Idrug_1-3          (naturally coded; _Idrug_1 omitted)
(est1 stored)

. lab var _Idrug_2 "Tadalafil"

. lab var _Idrug_3 "Sildenafil"

. esttab, eform wide ci nostar label refcat(_Idrug_2 "Placebo")

----------------------------------------------
                             (1)
                              _t
----------------------------------------------
Placebo                      ref.
Tadalafil                   0.231 [0.0894,0.596]
Sildenafil                 0.0707 [0.0213,0.235]
----------------------------------------------
Observations                   48
----------------------------------------------
Exponentiated coefficients; 95% confidence intervals in brackets

. esttab, eform wide ci nostar label refcat(_Idrug_2 "Placebo", label(1))

----------------------------------------------
                             (1)
                              _t
----------------------------------------------
Placebo                         1
Tadalafil                   0.231 [0.0894,0.596]
Sildenafil                 0.0707 [0.0213,0.235]
----------------------------------------------
Observations                   48
----------------------------------------------
Exponentiated coefficients; 95% confidence intervals in brackets

. eststo clear

ben

On 6/11/07, Jannik Helweg-larsen <[email protected]> wrote:
( Stata 9.2+ estout- fully updated:)

Just discovered Benn Janns extremely  useful commands esto/esta.One
question for esta:

Is it somehow possible to make esta keep/inherit the  variable/value
labels after using xi e.g in line with what " reformat" (by Tony
Brady) does?

Example (needs estout and reformat installed from ssc):

sysuse cancer
label define drug 1 "Placebo" 2 "Tadalafil" 3 "Sildenafil"
label val drug drug

stset studytime, failure(died)

esto: xi: stcox i.drug

estadd expb

esta, main(expb) wide ci nostar

--------------------------------------
                      (1)
                       _t
--------------------------------------
_Idrug_2            0.231 [-2.415,-0.518]
_Idrug_3           0.0707 [-3.849,-1.449]
--------------------------------------
N                      48
--------------------------------------
expb coefficients; 95% confidence intervals in brackets

I would prefer to get the following type of output, in which the
original labels for drug are inherited:

xi: stcox i.drug
reformat

-----------------------------------------------------------------------------
Covariate               Haz. Ratio  Std. Err.     P>|z|    95% Conf. Interval
-----------------------------------------------------------------------------
Drug type (1=placebo)
 Placebo*                       1
 Tadalafil                  0.231      0.112     0.002      (0.089 to 0.596)
 Sildenafil                 0.071      0.043    <0.001      (0.021 to 0.235)
-----------------------------------------------------------------------------
* Baseline category

bw

Jannik
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index