Bookmark and Share

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


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

Re: st: Adding wald test using esttab.


From   Tim Wade <[email protected]>
To   [email protected]
Subject   Re: st: Adding wald test using esttab.
Date   Wed, 11 May 2011 17:45:57 -0400

Sumedha, this should work:


clear
sysuse auto
 eststo R1: quietly regress price weight mpg
 eststo R2: quietly regress price weight mpg foreign
suest R1 R2
test [R1_mean]weight=[R2_mean]weight
estadd scalar test=r(p): R1
esttab R1 R2, stats(test)


. esttab R1 R2, stats(test)

--------------------------------------------
                      (1)             (2)
                    price           price
--------------------------------------------
weight              1.747**         3.465***
                   (2.72)          (5.49)

mpg                -49.51           21.85
                  (-0.57)          (0.29)

foreign                            3673.1***
                                   (5.37)

_cons              1946.1         -5853.7
                   (0.54)         (-1.73)
--------------------------------------------
test             0.000932
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

Tim


On Wed, May 11, 2011 at 4:54 PM, Gupta, Sumedha <[email protected]> wrote:
> Hi,
>
> I am looking for some guidance on how to add the wald test for difference between coefficients from two models to a table generated using esttab. I do the following:
>
>  sysuse auto
> (1978 Automobile Data)
>
> . eststo R1: quietly regress price weight mpg
>
> . eststo R2: quietly regress price weight mpg foreign
>
> . esttab
>
> --------------------------------------------
>                      (1)             (2)
>                    price           price
> --------------------------------------------
> weight              1.747**         3.465***
>                   (2.72)          (5.49)
>
> mpg                -49.51           21.85
>                  (-0.57)          (0.29)
>
> foreign                            3673.1***
>                                   (5.37)
>
> _cons              1946.1         -5853.7
>                   (0.54)         (-1.73)
> --------------------------------------------
> N                      74              74
> --------------------------------------------
> t statistics in parentheses
> * p<0.05, ** p<0.01, *** p<0.001
>
> Now I want to test if the weight coefficient in model 1 is statistically different from that in Model 2. In my own program the following works:
>
> suest R1 R2
> test [R1]weight=[R2]weight
>
> But here I get the following error:
> equation [R1] not found
>
> So my first question is how to conduct the above test. Second is how to add the p value from the above Wald test to the table generated using esttab?
>
> Any help will be much appreciated. Many thanks!
> - Sumedha.
>
>
>
>
>
>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index