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: suest after ivregress or ivreg2


From   richard boylan <[email protected]>
To   [email protected]
Subject   Re: st: suest after ivregress or ivreg2
Date   Wed, 7 Apr 2010 16:12:32 -0500

Ok, I understand. Thanks so much.

On Wed, Apr 7, 2010 at 3:26 PM, Austin Nichols <[email protected]> wrote:
> Try this.
>
> est clear
> sysuse auto, clear
> ren weight z
> ren headroom x
> ivregress 2sls price (x=z)
> estimates store one
> ren x headroom
> ren turn x
> ivregress 2sls price (x=z) mpg
> estimates store two
> ren x turn
> preserve
> g i=_n
> expand 2
> bys i: g n1=_n-1
> g x1=headroom*!(n1==0)
> g z1=z*!(n1==0)
> g x2=turn*!(n1==1)
> g z2=z*!(n1==1)
> replace mpg=0 if n1==1
> g n2=1-n1
> ivregress 2sls price (x1 x2=z1 z2) mpg n1 n2, cl(i) nocons
> est sto stacked
> test x1=x2
> testnl _b[x1]*_b[x2]=_b[mpg]
> restore
> esttab one two stacked, nogaps mti
>
>
> On Wed, Apr 7, 2010 at 3:54 PM, richard boylan <[email protected]> wrote:
>> Ok. This is what I am trying to do.
>>
>> sysuse auto.dta
>> ivregress 2sls price (headroom = weight) mpg
>> estimates store one
>> ivregress 2sls price (turn = weight)
>> estimates store two
>> suest one two
>> testnl [one]headroom*[two]turn = [one]mpg
>>
> *
> *   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