Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: estout command


From   Tim Wade <wadetj@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: estout command
Date   Sun, 17 Oct 2010 12:20:39 -0400

Did you try using -estadd- with the stats option in -estout-? (both
ser written programs by Ben Jann, available from SSC. type:  findit
estadd)

Something like:

clogit case,group(set) or
estimates store null_model

foreach myvar of varlist x1 x2 x3 x4 x5{
clogit case i.`myvar',group(set) or
estimates store `myvar'
lrtest `myvar' null_model
estadd scalar p_lr=r(p)
estout `myvar' using estout_table.xls, stats(p_lr) cells("b
(fmt(%5.2f)) ci (fmt(%6.2f)") eform  refcat(`myvar') append

}


I could not test this since I don't have a reproducible data set. It
would put the p-value in a row at the bottom of each column.

Hope this helps, Tim



On Sat, Oct 16, 2010 at 12:35 PM, Nikolaos Pandis <npandis@yahoo.com> wrote:
> Hi to all.
>
> I running the following loop for a set of categorical variable x1-x5 as shown below:
> ........................................
> foreach myvar of varlist x1 x2 x3 x4 x5{
> clogit case i.`myvar',group(set) or
> estimates store `myvar'
> clogit case,group(set) or
> estout `myvar' using estout_table.xls,cells("b (fmt(%5.2f)) ci (fmt(%6.2f)") eform  refcat(`myvar') append
> }
> ......................................
>
>
> I would like to perform an -lrtest- for each variable (after -clogit-) vs the null model, which would be included in the previous code:
> ................................
> clogit case,group(set) or
> estimates store null_model
> lrtest `myvar' null_model
> ...........................
>
> Question. I was wondering if there is a way to include the result of the LR test in the estout output and add it on the last column. I understand that I could add the -p- in parenthesis in the cells option for the Wald test between baseline and each category but I do not need this.
>
> Many thanks,
>
> Nick
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index