Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: "RE: estout and test


From   JP Azevedo <jp.statalist@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: "RE: estout and test
Date   Wed, 7 Sep 2005 11:58:00 -0300

Dear Ben,

Many thanks for your prompt reply.

I have another question regarding erest2 and estout (of course the
question is targeted to the whole list).

How can I use eret2 matrix to display the results.

I've tried the syntax below but things did not work as I expected.

sysuse auto, clear

test weight = mpg
mat tmp = r(F) , r(p) , r(df)
eret2 matrix tmp = tmp, replace

estout, cells("tmp")

        .
        tmp
weight  
mpg     
_cons   

estout, stats("tmp")
        .
        b
weight  1.746559
mpg     -49.51222
_cons   1946.069
tmp     



On 9/7/05, Jann  Ben <ben.jann@soz.gess.ethz.ch> wrote:
> JP writes:
> > I'm trying to use estout to format the coefficients of
> > several regressions
> > as well as the result of an F test that I'm implementing on
> > each of of these
> > models. I've been trying to use eret2 to store the pvalues of
> > my F test, ...
> ...
> > it does not produce the desired effects when I'm trying to store the
> > results of multiple models through the command estimates store
> > (Example 2).
> ...
> > ********************* Example 2 *********************
> >
> > sysuse auto, clear
> >
> > regress price weight mpg
> > estimates store m1
> > test weight = mpg
> > eret2 scalar p_wtmpg = r(p)
> >
> > regress price weight mpg length turn
> > estimates store m2
> > test weight = mpg = length = turn
> > eret2 scalar p_wtmpg = r(p)
> >
> > estout m*, stats(N r2 r2_a p_wtmpg) style(fixed)
> 
> -eret2- adds stuff to the "active" estimates. However, the
> "active" estimates have nothing to do with the "stored"
> estimates. Active and stored estimates are two distinct
> sets of e()-returns in Stata.
> 
> Thus, if you are working with stored estimates and you want
> to use -eret2-, always store the estimates AFTER applying
> -eret2-. Otherwise, the added statistics will not be part
> of the stored estimates and cannot be tabulated by -estout-.
> 
> That is, JP's code should be as follows:
> 
>  . regress price weight mpg
>  . test weight = mpg
>  . eret2 scalar p_wtmpg = r(p)
>  . estimates store m1
> 
>  . regress price weight mpg length turn
>  . test weight = mpg = length = turn
>  . eret2 scalar p_wtmpg = r(p)
>  . estimates store m2
> 
>  . estout m*, stats(N r2 r2_a p_wtmpg) style(fixed)
> 
> An alternative is to write a routine for -estadd-, that
> conducts the F test. Other than -eret2-, -estadd- can
> deal with estimates that have already been stored. See
> 
>  . ssc describe estadd
> 
> ben
> 
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index