I have a panel dataset with around 30,000 individuals observed for four years all over the US. My dependent variable is a binary variable that depends on individual characteristics and state characteristics. I want to isolate the variance in my dependent variable across states while controlling for individual fixed effects. My approach has been to fit a multilevel model using the -mixed- command and -predict- to obtain the BLUP at the state level according to the following, where the individual identifier is ID and the state identifier is state:
Code:
mixed dependent_variable ID || state: predict blup_state , reffects
Secondly, since I have worked with a different version of stata before, which didn't allow me to specify a model using the -mixed- command with such a high number of categorical variables to control for, I have partialed out the individual fixed effects manually and used the -mixed- command with the predicted residuals according to:
Code:
areg dependent_variable, absorb(ID) predict dependent_variable_resid, resid mixed dependent_variable_resid || state: predict blup_resid_state, reffects
Comments are greatly appreciated.
0 Response to Multilevel Model with Individual fixed effects
Post a Comment