Dear all,
I want to carry out a two-stage Heckman correction using two samples. I have one dataset that gives me the selection to higher education and a second one in which I can only observe observation i (admission to an elite university department) if y*_i>0 (i.e if someone is admitted to higher education). I observe the same variables in both datasets. The only thing I do not observe in the second sample is selection (admission to higher education), nor do I observe the outcome of interest in the first dataset (admission to an elite university department). I want to estimate the selection equation with the first dataset and use the parameter estimates to construct the inverse mills ratio using the second dataset. I am using data frames to store both datasets in memory and i am running the following code:
**Step 1: linear predictions from selection equation:
probit HIGHEREDU i.yeard i.edu_f#i.yeard i.occup_f i.sex_stud i.nationality unemp_1, baselevels
frame change admissions
predict p1_hat, xb // Calculate predicted value from regression
** Compute Inverse Mills ratio
generate phi_1=normalden(p1_hat)
generate PHI_1=normal(p1_hat)
generate lambda_1=phi/PHI
The "predict p1_hat, xb" command generates only missing values as i think that the estimated parameters are lost when i change frames. Is there any way to store the estimated parameters from the first frame and then use them to construct the inverse mills ratio in the second dataset/frame?
Any help would be very valuable.
Best regards,
Konstantina
I want to carry out a two-stage Heckman correction using two samples. I have one dataset that gives me the selection to higher education and a second one in which I can only observe observation i (admission to an elite university department) if y*_i>0 (i.e if someone is admitted to higher education). I observe the same variables in both datasets. The only thing I do not observe in the second sample is selection (admission to higher education), nor do I observe the outcome of interest in the first dataset (admission to an elite university department). I want to estimate the selection equation with the first dataset and use the parameter estimates to construct the inverse mills ratio using the second dataset. I am using data frames to store both datasets in memory and i am running the following code:
**Step 1: linear predictions from selection equation:
probit HIGHEREDU i.yeard i.edu_f#i.yeard i.occup_f i.sex_stud i.nationality unemp_1, baselevels
frame change admissions
predict p1_hat, xb // Calculate predicted value from regression
** Compute Inverse Mills ratio
generate phi_1=normalden(p1_hat)
generate PHI_1=normal(p1_hat)
generate lambda_1=phi/PHI
The "predict p1_hat, xb" command generates only missing values as i think that the estimated parameters are lost when i change frames. Is there any way to store the estimated parameters from the first frame and then use them to construct the inverse mills ratio in the second dataset/frame?
Any help would be very valuable.
Best regards,
Konstantina
Comment