Hello,

I am using a control function approach to correct for an endogenous ordinal variable (with three categories) in a panel dataset. I am basing this approach on Wooldridge (2014) who recommends using generalized residuals from the first stage, which in my case is an ordered probit (xtoprobit). The generalized residuals are written as follows:

gr = yi2λ(ziβ) - (1 - yi2)λ(-ziβ)

where yi2 is the endogenous variable and λ(.) is the inverse Mills ratio from the first stage.

However, for xtoproit, there does not appear to a post-estimation command for the inverse Mills ratio. Therefore, I am wondering if the following code would work:

Code:
 xtoprobit ...
predict probitxb, xb
gen pdfprobit = normalden(probitxb)
gen cdfprobit = normprob(probitxb)
gen lamda = pdfprobit/cdfprobit
Or is this incorrect given that my variable is ordinal?

If the code is correct, can we then simply do the following to compute λ(-ziβ)?

Code:
gen pdfprobit_n = normalden(-probitxb)
gen cdfprobit_n = normprob(-probitxb)
gen lamda_n = pdfprobit_n/cdfprobit_n
And then do we simply generate a variable with these two IMRs?

Code:
gen gr = y2*lamda -  (1 - y2)*lamda_n
Once again, I particularly concerned about whether this is correct given that my endogenous variable is not binary.

Reference:

Wooldridge, J. 2014. "Quasi-maximum likelihood estimation and testing for nonlinear models with endogenous explanatory variables."
https://econpapers.repec.org/article..._3a226-234.htm


EDIT:

It seems that given that the variable is ordinal, the code I have written above will not work, as the formula for the generalized residuals in Chiburis and Lokshin (2007) for an ordinal probit is much more complex. However, they do not present their formula in a panel data context. So, it seems my general point about there not being a "canned" post-estimation code to estimate the generalized residuals for xtoprobit still stands. Would the right approach, then, be to create a code replicating their equation 5?

Reference:

Chiburis and Lokshin, 2007. "Maximum likelihood and two-step estimation of an ordered-probit selection model."
https://journals.sagepub.com/doi/pdf...867X0700700202