use $mydata/prosoc/us_fr_APC.dta , clear // These lines should be in each session! su * // what is in ? * * first APC-Detrended model * Searching for lucky/unlucky cohorts * levelsof iso2, local(cnty) // foreach l of local cnty { // loop over countries capt noi di "`l'" // We want the name of the country at the output of each analysis apcd leqdhi [w=pw] if page>=25 & page<=55 & iso2=="`l'" , age(page) period (year5) // APCD model (Age-period-cohor detrended) } ** APCD model (Age-period-cohor detrended) - easier to plot foreach l of local cnty { capt noi di "`l'" capture apcd leqdhi [w=pw] if page>=25 & page<=55 & iso2=="`l'" , age(page) period (year5) capture estout , cells(b ci_u ci_l) // We want an easier to plot output matlist r(coefs) } * * APC-Trended model: how the trend changed/can be compared * Showing the trend * levelsof iso2, local(cnty) // foreach l of local cnty { capt noi di "`l'" apctlag leqdhi [w=pw] if page>=25 & page<=55 & iso2=="`l'" , age(page) period (year5) rep(2) // APCTlag (APC trended lag) model - no contrlos } * * APC-Trended model: how the trend changed/can be compared * Showing the trend, after control by XXX (including tertiary education = ter) * levelsof iso2, local(cnty) // foreach l of local cnty { capt noi di "`l'" apctlag leqdhi partner female ter [w=pw] if page>=25 & page<=55 & iso2=="`l'" , age(page) period (year5) rep(2) // now with control for gender, education and partner } * * APC-GO: did the gap between tertiary educated and the others changed * levelsof iso2, local(cnty) // foreach l of local cnty { capt noi di "`l'" apcgo leqdhi partner female [w=pw] if page>=25 & page<=55 & iso2=="`l'" , age(page) period (year5) gap(ter) rep(2) // the gap in income between tertiary and non-terttary, with the contribution of the control variables } ** gini * * APC-Trended model: how the gini evolved across cohorts * levelsof iso2, local(cnty) // gen gini=. foreach l of local cnty { capt noi di "`l'" qui { forvalues ii=1985(5)2010 { forvalues jj=25(5)55{ fastgini leqdhi [w =pw] if year5==`ii' & page==`jj' & iso2=="`l'" // we calculate the gini for each cell in the Lexiss table replace gini=r(gini) if year5==`ii' & page==`jj' & iso2=="`l'" // we give each individual in the cell the gini value of the cell } } } apctlag gini [w=pw] if page>=25 & page<=55 & iso2=="`l'" , age(page) period (year5) rep(2)