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]

st: Loop for Heckman selection model with unbalanced panel

From   Suryadipta Roy <>
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,

*   For searches and help try:

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