Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Estout for multiple heckman models


From   "Ben Jann" <[email protected]>
To   <[email protected]>
Subject   st: RE: Estout for multiple heckman models
Date   Wed, 8 Nov 2006 10:43:43 +0100

Wow. This looks complicated. Getting rid of all the 
labeling and formatting stuff, the -estout- command 
essentially boils down to

 . estout ..., keep(black hispanic ...) 

My first observation is that Matthew's -estout- is not 
up to date. Otherwise, all results would have been 
displayed (although terribly unordered). So, please 
type 

 . ssc install estout, replace

The problem with -heckman- is that there are multiple 
equations, all being labeled differently, and -estout-
may have to be told how to match equations across 
models. The default is to match by name, which is good 
in many contexts. However, if the models have multiple 
equations and if the dependent variables are different
then matching by name will produce an unordered table.

The solution usually is to specify -equations(1)-,  
short -eq(1)-, causing the first equations from the 
models to be matches.

Thus, Matthew should type 

 . estout ..., eq(1) keep(black hispanic ...)

Note that the table will also include the results from 
the heckman selection equation and the auxiliary 
parameters. To get rid of these, use the -drop()- 
option. However, the specification of -drop()- depends
on how exactly the -heckman- models have been set up 
(which is not clear from Matthews code). Possibly, 

 . estout ..., eq(1) keep(black hispanic ...) drop(select:)

will do.

I hope this helps,
ben

Matthew wrote:
> I have been using the estout code at the bottom of this message for a
> while with no problems.  However, when I recently changed some of the
> models from reg to heckman, I can no longer get all of them to
> display in the table.  The values in e( ) have the same name for both
> reg and heckman (the ones I want, at least), so I can't figure out
> why estout doesn't want to diaplay them together.  In fact, when I
> try to get only the heckman models to display it the same table, only
> the first one displays, with an extra row at the top containing the
> name of the dep. var. in the first column.  I have searched estout
> help to no avail, so any suggestions are greatly appreciated.
> 
> Matthew
> 
> My code:
> 
> ***the first two regressions***
> svy: reg foodbev black hispanic asian levexp educ_ref age_ref age2
> fam_size malehead femhead neurb mwurb surb wurb yeardum*
> estimates store foodbev
> estadd ysumm
> 
> svy: reg hous black hispanic asian levexp educ_ref age_ref age2
> fam_size malehead femhead neurb mwurb surb wurb yeardum*
> estimates store hous
> estadd ysumm
> 
> ***the series of heckman regressions**
> foreach v in cpe health trans entert learn persin cashco {
> svy: heckman `v' black hispanic asian levexp educ_ref age_ref age2
> fam_size malehead femhead neurb mwurb surb wurb yeardum*, select
> (`selection')
> estimates store `v', title ((6))
> estadd ysumm
> }
> 
> ***trying to combine them all in an estout table (this works fine if
> the heckmans are changed to reg)***
> estout foodbev hous cpe health transp entert learn persin cashco
> using "file_location", stats(r2 N ymean ysd, fmt(%9.2f %9.0f %9.0f %
> 9.0f) ///
> labels("R$^2$" "N. of obs." "Mean of Dep. Var." "S.D. of Dep. Var."))
> cells(b(star fmt(%9.2f)) se(par fmt(%9.2f))) label msign(--) ///
> starlevels(* 0.10 ** 0.05 *** 0.01) keep(black hispanic asian levexp
> educ_ref age_ref age2 fam_size malehead femhead) ///
> style(tex) title(Full Sample) collabels([dep]) mlabels(Food Housing
> CPE Health Transp. Entert. Edu. Pens./Ins. Contrib., span prefix
> (\multicolumn{@span}{c}{) suffix(})) ///
> prehead("\begin{sidewaystable}\caption{@title}" "\begin{center}\begin
> {small}" "\begin{tabular}{l*{@M}{rr}}\hline") posthead(\hline) ///
> prefoot("Year Effects&Yes&Yes&Yes&Yes&Yes&Yes&Yes&Yes&Yes\\ \\ Region
> Effects&Yes&Yes&Yes&Yes&Yes&Yes&Yes&Yes&Yes\\ \\ \hline" ) ///
> postfoot("\hline" "\multicolumn{3}{l}{Robust Standard Errors in
> Parentheses} \\" ///
> "\multicolumn{6}{l}{Significance levels: *10\%; ** 5\%; *** 1\%} \
> \""\small\textit{Source:} CEx 1996-2002" ///
> "\end{tabular}\end{small}\end{center}\end{sidewaystable}")

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index