use https://www3.nd.edu/~rwilliam/statafiles/bollenbrand, clear * Files get written to the current Stata directory so make sure you * change the following to be where you want to be. cd "C:\Temp\" * If you want Stata to run the models, delete the dryrun option. Be * forewarned, however, that Stata can be painly slow compared * to Mplus, although the smaller models aren't too horrendous. * Existing .inp and .dat files by the given names will be deleted, so change * the Mplus names or drop the r option if you don't want that. * Replicate Bollen & Brand 2010 Social Forces Paper, Most of Table 3, * some Table 5 * Random Effects Model 1 xtdpdml lnwg hchild, ylag(0) re fiml tfix errorinv /// dryrun ti(Bollen & Brand Social Forces 2010 Random Effects Model 1 Table 3 p. 15) mplus(re1, r) !mplus re1.inp *doedit re1.out * Random Effects Model 2 xtdpdml lnwg hchild marr div, ylag(0) re fiml tfix errorinv /// dryrun ti(Bollen & Brand Social Forces 2010 Random Effects Model 2 Table 3 p. 15) mplus(re2, r) !mplus re2.inp *doedit re2.out * Random Effects Model 3 xtdpdml lnwg hchild marr div eduatt cursc snrpt snrft exppt expft break , ylag(0) re fiml tfix errorinv /// dryrun ti(Bollen & Brand Social Forces 2010 Random Effects Model 3 Table 3 p. 15) mplus(re3, r) !mplus re3.inp *doedit re3.out * Fixed Effects Model 1 xtdpdml lnwg hchild, ylag(0) fiml tfix errorinv /// dryrun ti(Bollen & Brand Social Forces 2010 Fixed Effects Model 1 Table 3 p. 15) mplus(fe1, r) !mplus fe1.inp *doedit fe1.out * Fixed Effects Model 2 xtdpdml lnwg hchild marr div, ylag(0) fiml tfix errorinv /// dryrun ti(Bollen & Brand Social Forces 2010 Fixed Effects Model 2 Table 3 p. 15) mplus(fe2, r) !mplus fe2.inp *doedit fe2.out * Fixed Effects Model 3 xtdpdml lnwg hchild marr div eduatt cursc snrpt snrft exppt expft break , ylag(0) fiml tfix errorinv /// dryrun ti(Bollen & Brand Social Forces 2010 Fixed Effects Model 3 Table 3 p. 15) mplus(fe3, r) !mplus fe3.inp *doedit fe3.out * The hybrid model in Table 3 requires hand tweaking the code. For example, you can take * Mplus code for re3.inp, and change the @0 for vars eduatt cursc snrft1 expft break * to *. Remember to do so for all 6 time periods. ********************************************* * Some lagged IV models from Table 5. * Model 5b2, Lagged dv, Tables 5 & 6 xtdpdml lnwg hchild marr div eduatt cursc snrpt snrft exppt expft break , alphafree errorinv fiml tfix /// inv(black hisp) dryrun ti(Bollen & Brand Social Forces 2010 Table 6 last model p. 22) mplus(m5b2, r) !mplus m5b2.inp *doedit m5b2.out * Model 5b*, Lagged dv, child effects free to vary across time, Table5 xtdpdml lnwg hchild marr div eduatt cursc snrpt snrft exppt expft break , alphafree errorinv fiml tfix /// inv(black hisp) xfree(hchild) dryrun ti(Bollen & Brand Social Forces 2010 Table 5 Model 5b*) mplus(m5b3, r) !mplus m5b3.inp *doedit vs m5b3.out