I am trying to manually calculate the predicted probability from a dynamic correlated random effects probit model, because I want to change the values of certain variables for simulation. I simplified my model to the following for ease of understanding, where employment status is the dependent variable, and regressors include: lagged and initial status, type of household (3 types), age, labour market entry age, and mean of time varying variables.
However, I encountered 2 problems:
(1) The mean predicted probability I got is much much higher than the stata predict command which sets unobserved effect to zero. How shall I correct my command for correct estimation?
(2) How can I write the part of command for calculating the interaction term i.hhtype#c.age?
Stata command:
xtprobit employment i.lagged_employment i.hhtype##c.age entryage initial_employment hhtype1_mean hhtype2_mean hhtype3_mean, i(RINPERSOON)
predict p0, pu0
sum p0
* p0 has a mean of 0.13
To simulate probability given labour market entry age at 18:
gen yhat = normal(_b[_cons] + _b[1.lagged_employment]*lagged_employment + _b[2.hhtype]*hhtype + _b[3.hhtype]*hhtype + _b[age]*age + _b[entryage]*18 + _b[i.initial_employment]*initial_employment + _b[hhtype1_mean]*hhtype1_mean + _b[hhtype2_mean]*hhtype2_mean + _b[hhtype3_mean]*hhtype3_mean)
gen pr = exp(yhat)/(1+exp(yhat))
* pr has a mean of 0.51
Thank you very much for your help indeed!
However, I encountered 2 problems:
(1) The mean predicted probability I got is much much higher than the stata predict command which sets unobserved effect to zero. How shall I correct my command for correct estimation?
(2) How can I write the part of command for calculating the interaction term i.hhtype#c.age?
Stata command:
xtprobit employment i.lagged_employment i.hhtype##c.age entryage initial_employment hhtype1_mean hhtype2_mean hhtype3_mean, i(RINPERSOON)
predict p0, pu0
sum p0
* p0 has a mean of 0.13
To simulate probability given labour market entry age at 18:
gen yhat = normal(_b[_cons] + _b[1.lagged_employment]*lagged_employment + _b[2.hhtype]*hhtype + _b[3.hhtype]*hhtype + _b[age]*age + _b[entryage]*18 + _b[i.initial_employment]*initial_employment + _b[hhtype1_mean]*hhtype1_mean + _b[hhtype2_mean]*hhtype2_mean + _b[hhtype3_mean]*hhtype3_mean)
gen pr = exp(yhat)/(1+exp(yhat))
* pr has a mean of 0.51
Thank you very much for your help indeed!
Comment