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]

st: Loop for Heckman selection model with unbalanced panel


From   Suryadipta Roy <[email protected]>
To   [email protected]
Subject   st: Loop for Heckman selection model with unbalanced panel
Date   Wed, 13 Feb 2013 22:04:32 -0500

Dear Statalisters,

I have a couple of objectives that I am trying to achieve based on the
codes below, and would sincerely appreciate any feedback. I have an
unbalanced time series cross section data (from 1984 - 2010), and
trying to estimate the inverse Mills ratio for all observations in
each year, and then introduce them in a fixed effects regression for
the observed dependent variable. I have included averages of
time-varying explanatory variables in the primary equation (gm*) to
allow for correlation between the unobserved effects and the
explanatory variables. 'controls' is a local created before containing
the relevant explanatory variables.

forvalues year=1984/2010 {
probit d_import `controls'  i.importer_dummy_* i.exporter_dummy_* ,
vce(cluster country_pair) /* selection equation */
predict z_hat_`year', xb
predict pr_`year', pr
gen pdf_z_hat_`year' = normalden(z_hat_`year')
gen cdf_z_hat_`year' = normprob(z_hat_`year')
gen eta_hat_`year' = pdf_z_hat_`year' / cdf_z_hat_`year'
}

* Heckit with panel data
areg ln_import `controls' gm* eta_hat_`year' , absorb(country_pair)
robust cluster(country_pair) /* primary equation */

Any comment if I am in the right direction and suggestions will be
greatly appreciated,

Sincerely,
Suryadipta.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index