for my current research, I employ a hybrid logit model for a binary outcome variable following Allison (2009) on how to write the Stata code for the hybrid model by hand. Because of imputed data in my dataset (mi set wide), I cannot use Perales and Schunk’s xthybrid command.
I fit the random effects model using the xtlogit command with the following variables (stata 15):
- binary Outcome
- Var_1 (time-varying)
- Var_2 (time-varying)
- Var_3 (time-varying)
- Var_4 (time-invariant)
- Var_5 (time-invariant)
I also included an interaction of Var_3 (time-varying) and Var_5 (time-invariant) in the model. Following the advice by Allison, I treated the Interaction as just another variable. Thus, I first created the product Var_3XVar_5 and then calculated the means (m_Var_3XVar_5) and deviations (d_Var_3XVar_5) of that product.
My model looks like this:
Code:
mi estimate, dots saving(miestfile_H1, replace): xtlogit Outcome d_Var_1 d_Var_2 d_Var_3 m_Var_1 m_Var_2 m_Var_3 Var_4 Var_5 d_Var_3XVar_5 m_Var_3XVar_5, re i(ID)
Code:
mi estimate using miestfile_H1, or
After estimating the model with mi estimate, I write the following code:
Code:
mimrgns, predict(pr) dydx(*) eform
Can anyone help me?
0 Response to xtlogit: hybrid model by hand. How to obtain average marginal effects using mimrgns
Post a Comment