Statalist


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

Re: st: esttab, stata 11, and gmm


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: esttab, stata 11, and gmm
Date   Fri, 31 Jul 2009 09:02:54 -0400

Pierre--
Try e.g.:

version 11
clear all
prog eqn2coef, eclass
 version 9.2
 syntax [, Edit(string) to(string) ]
 tempname b V
 mat `b'=e(b)
 mat `V'=e(V)
 loc cmd `e(cmd)'
 loc N `e(N)'
 tempvar touse
 g byte `touse'=e(sample)
 forv i=1/`=colsof(`b')' {
  mata: chColNames("`b'",`i')
  loc r `"`r' `"main:`r1'"'"'
  }
 loc r: subinstr  loc r `"`edit'"' `"`to'"',all
 mat colnames `b' = `r'
 mat rownames `V' = `r'
 mat colnames `V' = `r'
 eret post `b' `V', e(`touse') obs(`N')
 eret local cmd `"`cmd'"'
end
mata:
 void chColNames(string scalar b, real scalar i)
 {
   r=st_matrixcolstripe(b)
   st_local("r1", r[i,1])
   st_local("r2", r[i,2])
 }
end
use http://fmwww.bc.edu/RePEc/bocode/i/ivp_bwt.dta, clear
g lnbw=ln(bw)
loc x "parity white male"
loc z "edfwhite edmwhite incwhite cigtax88"
qui ivreg2 lnbw `x' (cigspreg=`z')
est sto ivreg2
qui ivpois bw `x', endog(cigspreg) exog(`z')
est sto ivpois
qui gmm (bw-exp({x:cigspreg `x'} + {_cons})), instruments(`x' `z')
eqn2coef, e(x_)
est sto gmm
esttab *, nogaps eq(1) mti


On Thu, Jul 30, 2009 at 9:25 PM, Pierre Azoulay<pierre.azoulay@gmail.com> wrote:
> Dear Statalisters,
>
> I am wondering if any of you came across this problem.
> I am estimating a treatment effect model. There is really one variable
> of interest. let's call it "treat".
> I am estimating a bunch of model using Poisson models, and a final,
> preferred one using gmm. The coefficient in the gmm equation for treat
> is /b1. I am trying to use esttab to creat a table of results with
> just one variable, treat. But I am having a hard time combining the
> poisson and GMM results into one table.
>
> esttab *, keep(treat) varwidth(25) nonumber noobs nogaps nodep label
> b(%5.3f) se(%5.3f) star(† 0.10 * 0.05 ** 0.01) compress sfmt(%10.3fc
> %10.0fc) eqlabels(none) mlabels("X-Sec" "ATE" "ATT" "DD" "SDD")
>
> The last table corresponds to the GMM model, but the last cell is
> blank when I do this.
>
> Any idea on how to do this?
>
>
> Pierre
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index