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 on April 23, and its replacement, is already up and running.

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

Re: st: suest after ivregress or ivreg2

From   Austin Nichols <>
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
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]
esttab one two stacked, nogaps mti

On Wed, Apr 7, 2010 at 3:54 PM, richard boylan <> 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:

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