Hi, in the code below, the first two approaches generate the same results, which is expected because the CRE and FE estimators are the same. I am also trying to manually do the Mundlak approach because I want to use CRE for logit, and the cre command is only for linear regressions. I first did a linear regression to see if my results would be the same, but they are not. My panel is unbalanced, so I included means for each year (even without them, my coefficients are not the same as cre and fe approaches). I would appreciate any insight as to what I am doing wrong.
xtset child_placement year
xtreg good_outcome placement_duration i.child_race ageatstart i.sex i.phys_abuse i.sex_abuse i.neglect i.alcohol_parent i.drug_parent i.alcohol_child i.drug_child i.removal_child_dis i.child_behavior_problem i.parent_death i.parent_jail i.no_cope i.abandonment i.relinquishment i.housing i.mental_retardation i.visual_hearing_dis i.physical_dis i.emotion_disturb i.other_dis i.current_placement i.rural_urban i.parent_1_race parent_1_age i.caretaker_fam_struct i.foster_fam_struct i.casegoal i.state i.year, cre vce(cluster child_placement)
xtreg good_outcome placement_duration duration i.child_race ageatstart i.sex i.phys_abuse i.sex_abuse i.neglect i.alcohol_parent i.drug_parent i.alcohol_child i.drug_child i.removal_child_dis i.child_behavior_problem i.parent_death i.parent_jail i.no_cope i.abandonment i.relinquishment i.housing i.mental_retardation i.visual_hearing_dis i.physical_dis i.emotion_disturb i.other_dis i.current_placement i.rural_urban i.parent_1_race parent_1_age i.caretaker_fam_struct i.foster_fam_struct i.casegoal i.state i.year, fe vce(cluster child_placement)
egen placement_duration_mean = mean(placement_duration), by(child_placement)
egen duration_mean = mean(duration), by(child_placement)
egen age_mean = mean(ageatstart), by(child_placement)
egen mental_retardation_mean = mean(mental_retardation), by(stfcid)
egen visual_hearing_mean = mean(visual_hearing), by(child_placement)
egen physical_dis_mean = mean(physical_dis), by(child_placement)
egen emotion_disturb_mean = mean(emotion_disturb), by(child_placement)
egen other_dis_mean = mean(other_dis), by(child_placement)
egen current_placement_mean = mean(current_placement), by(child_placement)
egen rural_urban_mean = mean(rural_urban), by(child_placement)
egen parent_1_age_mean = mean(parent_1_age), by(child_placement)
egen caretaker_fam_struct_mean = mean(caretaker_fam_struct), by(child_placement)
egen foster_fam_struct_mean = mean(foster_fam_struct), by(child_placement)
egen casegoal_mean = mean(casegoal), by(child_placement)
egen myear2008 = mean(2008.year), by(child_placement)
egen myear2009 = mean(2009.year), by(child_placement)
egen myear2010 = mean(2010.year), by(child_placement)
egen myear2011 = mean(2011.year), by(child_placement)
egen myear2012 = mean(2012.year), by(child_placement)
egen myear2013 = mean(2013.year), by(child_placement)
egen myear2014 = mean(2014.year), by(child_placement)
egen myear2015 = mean(2015.year), by(child_placement)
egen myear2016 = mean(2016.year), by(child_placement)
egen myear2017 = mean(2017.year), by(child_placement)
egen myear2018 = mean(2018.year), by(child_placement)
egen myear2019 = mean(2019.year), by(child_placement)
egen myear2020 = mean(2020.year), by(child_placement)
egen myear2021 = mean(2021.year), by(child_placement)
xtreg good_outcome placement_duration duration i.child_race ageatstart i.sex i.phys_abuse i.sex_abuse i.neglect i.alcohol_parent i.drug_parent i.alcohol_child i.drug_child i.removal_child_dis i.child_behavior_problem i.parent_death i.parent_jail i.no_cope i.abandonment i.relinquishment i.housing i.mental_retardation i.visual_hearing_dis i.physical_dis i.emotion_disturb i.other_dis i.current_placement i.rural_urban i.parent_1_race parent_1_age i.caretaker_fam_struct i.foster_fam_struct i.casegoal placement_duration_mean duration_mean age_mean mental_retardation_mean visual_hearing_mean physical_dis_mean emotion_disturb_mean other_dis_mean current_placement_mean rural_urban_mean parent_1_age_mean caretaker_fam_struct_mean foster_fam_struct_mean casegoal_mean i.state i.year myear2008 myear2009 myear2010 myear2011 myear2012 myear2013 myear2014 myear2015 myear2016 myear2017 myear2018 myear2019 myear2020 myear2021, re
xtset child_placement year
xtreg good_outcome placement_duration i.child_race ageatstart i.sex i.phys_abuse i.sex_abuse i.neglect i.alcohol_parent i.drug_parent i.alcohol_child i.drug_child i.removal_child_dis i.child_behavior_problem i.parent_death i.parent_jail i.no_cope i.abandonment i.relinquishment i.housing i.mental_retardation i.visual_hearing_dis i.physical_dis i.emotion_disturb i.other_dis i.current_placement i.rural_urban i.parent_1_race parent_1_age i.caretaker_fam_struct i.foster_fam_struct i.casegoal i.state i.year, cre vce(cluster child_placement)
xtreg good_outcome placement_duration duration i.child_race ageatstart i.sex i.phys_abuse i.sex_abuse i.neglect i.alcohol_parent i.drug_parent i.alcohol_child i.drug_child i.removal_child_dis i.child_behavior_problem i.parent_death i.parent_jail i.no_cope i.abandonment i.relinquishment i.housing i.mental_retardation i.visual_hearing_dis i.physical_dis i.emotion_disturb i.other_dis i.current_placement i.rural_urban i.parent_1_race parent_1_age i.caretaker_fam_struct i.foster_fam_struct i.casegoal i.state i.year, fe vce(cluster child_placement)
egen placement_duration_mean = mean(placement_duration), by(child_placement)
egen duration_mean = mean(duration), by(child_placement)
egen age_mean = mean(ageatstart), by(child_placement)
egen mental_retardation_mean = mean(mental_retardation), by(stfcid)
egen visual_hearing_mean = mean(visual_hearing), by(child_placement)
egen physical_dis_mean = mean(physical_dis), by(child_placement)
egen emotion_disturb_mean = mean(emotion_disturb), by(child_placement)
egen other_dis_mean = mean(other_dis), by(child_placement)
egen current_placement_mean = mean(current_placement), by(child_placement)
egen rural_urban_mean = mean(rural_urban), by(child_placement)
egen parent_1_age_mean = mean(parent_1_age), by(child_placement)
egen caretaker_fam_struct_mean = mean(caretaker_fam_struct), by(child_placement)
egen foster_fam_struct_mean = mean(foster_fam_struct), by(child_placement)
egen casegoal_mean = mean(casegoal), by(child_placement)
egen myear2008 = mean(2008.year), by(child_placement)
egen myear2009 = mean(2009.year), by(child_placement)
egen myear2010 = mean(2010.year), by(child_placement)
egen myear2011 = mean(2011.year), by(child_placement)
egen myear2012 = mean(2012.year), by(child_placement)
egen myear2013 = mean(2013.year), by(child_placement)
egen myear2014 = mean(2014.year), by(child_placement)
egen myear2015 = mean(2015.year), by(child_placement)
egen myear2016 = mean(2016.year), by(child_placement)
egen myear2017 = mean(2017.year), by(child_placement)
egen myear2018 = mean(2018.year), by(child_placement)
egen myear2019 = mean(2019.year), by(child_placement)
egen myear2020 = mean(2020.year), by(child_placement)
egen myear2021 = mean(2021.year), by(child_placement)
xtreg good_outcome placement_duration duration i.child_race ageatstart i.sex i.phys_abuse i.sex_abuse i.neglect i.alcohol_parent i.drug_parent i.alcohol_child i.drug_child i.removal_child_dis i.child_behavior_problem i.parent_death i.parent_jail i.no_cope i.abandonment i.relinquishment i.housing i.mental_retardation i.visual_hearing_dis i.physical_dis i.emotion_disturb i.other_dis i.current_placement i.rural_urban i.parent_1_race parent_1_age i.caretaker_fam_struct i.foster_fam_struct i.casegoal placement_duration_mean duration_mean age_mean mental_retardation_mean visual_hearing_mean physical_dis_mean emotion_disturb_mean other_dis_mean current_placement_mean rural_urban_mean parent_1_age_mean caretaker_fam_struct_mean foster_fam_struct_mean casegoal_mean i.state i.year myear2008 myear2009 myear2010 myear2011 myear2012 myear2013 myear2014 myear2015 myear2016 myear2017 myear2018 myear2019 myear2020 myear2021, re
Comment