Originally posted by FernandoRios
View Post
in 5.2 Parametric Correction it say that
PROCEDURE 5.2.1:
(i) For each time period, run probit of sit2 on 1, zit, zi line (which I assume is the average of the instrumental for each individual), i=1,...N, and obtain the inverse Mills ratios
when sit2 is "working" the indicator variable nad z the instrumental variable "market"
So i run this code to estimate the Inverse MIlls Ratio
Code:
clear all
set more off
webuse wagework
egen obs=sum(working), by(personid)
replace year=year-r(min)+1
scalar tmax=r(max)-r(min)+1
/*Media temporal market*/
local j = 0
foreach var of varlist market {
qui egen m`var' = mean(`var'), by(personid)
local j = `j' + 1
}
*GENERATE INVERSE MILLS RATIO FOR EACH T;
* Definir la macro year con el rango de años que deseas procesar.
*GENERATE INVERSE MILLS RATIO FOR EACH T;
gen lambda=.
local i = 1
while `i' <= tmax {
di "Year=" `i'
probit working age market mmarket if year == `i'
predict xb, xb
replace lambda = normalden(xb) / normal(xb) if year == `i'
drop xb
local i = `i' + 1
}
I don't know what I'm not understanding about the manual procedure.
Thank you very much for your time and help

Comment