Dear all,
After fitting my model using Heckman (MLE), I want to use -predictnl- to calculate the marginal effects for categorical variables, which appear in both selection and outcome equations.
I use the formula suggested by Hoffmann and Kassouf (2005), the marginal effect of the regressors on yi in the observed sample consists of two components. There is the direct effect on the mean of yi , which is β. In addition, for a particular independent variable, if it appears in the probability that z∗ i is positive, then it will influence yi through its presence in λi (i.e. the inverse mills' ratio)(Greene(2012, p.875) gives the formula for continuous variables).
For the 2th level of the categorical variable "household_income_R" that appear in both selection and outcome equations.
Its marginal effect is calculated as:
ME_2.household_income_R = beta_k + beta_lambda*[(normalden(xbprobit_2.household_income_R)/normal(xbprobit_2.household_income_R))-(normalden(xbprobit_base)/normal(xbprobit_base))]
beta_k--coefficient on 2.household_income_R in the outcome equation;
beta_lambda---coefficient on IMR from the outcome equation, MLE estimation, need to retrieve it, bc MLE doesn't estimate lambda directly.
xbprobit_2.household_income_R ---- predicted linear prediction (not probability) for 2th level of the categorical variable: household_income_R.
I know how to calculate predicted linear prediction (not probability) for each level of a categorical variable by using -margins-, as follows:
*xbsel linear prediction for selection equation
Code:
margins household_income_R, atmeans predict(xbsel) noestimcheck Adjusted predictions Number of obs = 5352 Model VCE : Robust Expression : Linear prediction of prob_buy_OG, predict(xbsel) at : LnAnnualPo~G = -.8428143 (mean) ... ------------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------------+---------------------------------------------------------------- household_income_R | <$24,999 | -1.755006 .0195863 -89.60 0.000 -1.793395 -1.716618 $25,000-$49,999 | -1.68961 .0124251 -135.98 0.000 -1.713963 -1.665257 $50,000-$69,999 | -1.638268 .0146462 -111.86 0.000 -1.666974 -1.609562 >=$70,000 | -1.602625 .0110286 -145.32 0.000 -1.624241 -1.581009 ------------------------------------------------------------------------------------
I don't think I can use -predictnl- to incorporate estimates from -margins-.
Does anyone know how to use -predictnl- or some other commands to calculate those marginal effects?
Thanks in advance.
Xiaojin
Hoffmann, R., & Kassouf, A. L. (2005). Deriving conditional and unconditional marginal effects in log earnings equations estimated by Heckman's procedure. Applied Economics, 37(11), 1303-1311.