Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Austin Nichols <austinnichols@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: suest after ivregress or ivreg2 |
Date | Wed, 7 Apr 2010 16:26:19 -0400 |
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 <richardtb25@gmail.com> 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/