// Sitz07_5 // ---------- clear capture mkdir sitz07_5 set output inform set memory 120m set scheme s1mono set more off do http://www.wzb.eu/~kohler/publications/klassenkampf/grtpaths.do graph export sitz07_5/export.eps, replace !epstopdf sitz07_5/export.eps -o=sitz07_5/fig1.pdf // Retrival // -------- mkdat /// afamstd bfamstd cfamstd dfamstd efamstd ffamstd gfamstd hfamstd /// ifamstd jfamstd kfamstd lfamstd mfamstd nfamstd ofamstd pfamstd /// qfamstd rfamstd sfamstd tfamstd ufamstd vfamstd /// egp84 egp85 egp86 egp87 egp88 egp89 egp90 egp91 egp92 egp93 egp94 /// egp95 egp96 egp97 egp98 egp99 egp00 egp01 egp02 egp03 egp04 egp05 /// using data/ , /// files(pgen) waves(a b c d e f g h i j k l m n o p q r s t u v) /// netto(-3,-2,-1,0,1,2,3,4,5) keep(sex gebjahr) clear holrein /// ap6801 bp9301 cp9601 dp9801 ep89 fp108 gp109 hp10901 /// ip10901 jp10901 kp10401 lp10401 mp11001 np11701 op12301 /// pp13501 qp14301 rp13501 sp13501 tp14201 up14501 vp154 /// using data/, /// files(p) waves(a b c d e f g h i j k l m n o p q r s t u v ) holrein /// i1110284 i1110285 i1110286 i1110287 i1110288 i1110289 i1110290 /// i1110291 i1110292 i1110293 i1110294 i1110295 i1110296 i1110297 /// i1110298 i1110299 i1110200 i1110201 i1110202 i1110203 i1110204 /// i1110205 /// e1110184 e1110185 e1110186 e1110187 e1110188 e1110189 e1110190 /// e1110191 e1110192 e1110193 e1110194 e1110195 e1110196 e1110197 /// e1110198 e1110199 e1110100 e1110101 e1110102 e1110103 e1110104 /// e1110105 /// using data/ /// , files(pequiv) waves(a b c d e f g h i j k l m n o p q r s t u v ) // Reshape // -------- soepren egp*, new(egp) wave(1984/2005) soepren ?famstd, new(fam) w(1984/2005) soepren ?hhnr, new(hnr) w(1984/2005) soepren ?netto, new(netto) w(1984/2005) soepren /// ap6801 bp9301 cp9601 dp9801 ep89 fp108 gp109 hp10901 /// ip10901 jp10901 kp10401 lp10401 mp11001 np11701 op12301 /// pp13501 qp14301 rp13501 sp13501 tp14201 up14501 vp154, /// new(lsat) w(1984/2005) soepren i11102??, new(income) w(1984/2005) soepren e11101??, new(whours) w(1984/2005) reshape long /// hnr egp income whours fam netto lsat, i(persnr) j(welle) // Mindestens 15 Teilnahmen! by persnr (welle), sort: gen byte bef = sum(netto == 1) by persnr (welle): replace bef = bef[_N] drop if bef < 15 drop bef // Dependent Variable (Life satisfaction) replace lsat = . if lsat < 0 // Control Variables // ----------------- // Unemployed vs. not employed gen unemp = inlist(egp,-2,15,18) if !inlist(egp,-3,-1,.) // Class of main worker by welle hnr (whours), sort: gen egph:egph = egp[_N] if egp[_N] < . recode egph (1 2=1) (3 4=2) (5 6 11 = 3) (8= 4) (9 10 = 5) (-2 15 18 = 6) (else = .) label define egph 1 "Service class" 2 "Routine non-manual" 3 "Self empl." /// 4 "Skilled worker" 5 "Unskilled Worker" 6 "Other (and missing)" // Work hours replace whours = . if whours < 0 replace whours = whours/52 // Income replace income = . if income == 0 replace income = income/(12*1000) // Hypothesis 1 // ------------ // Event indicator: First marriage by persnr (welle), sort: gen hoch1 = 1 if fam == 1 & fam[_n-1]==3 by persnr (welle): replace hoch1 = sum(hoch1) // Listwise deletion mark touse markout touse lsat hoch1 welle income unemp whours keep if touse // Models iis persnr eststo clear eststo: xtreg lsat hoch1, be eststo: xtreg lsat hoch1, fe eststo: xtreg lsat hoch1 welle, fe eststo: xtreg lsat hoch1 welle income unemp whours , fe esttab // Hypothesis 2 // ------------ // Event indicator: First marriage by persnr (welle), sort: replace hoch1 = sum(hoch1) by persnr (welle), sort: gen hoch2 = hoch1^2 // Models eststo clear eststo: xtreg lsat hoch1 hoch2, fe eststo: xtreg lsat hoch1 hoch2 welle, fe eststo: xtreg lsat hoch1 hoch2 welle income unemp whours , fe esttab // Hypothesis 3 // ------------ // Event indicator: Divorce by persnr (welle), sort: gen divorce = 1 if inlist(fam,2,4) & fam[_n-1]==1 by persnr (welle): replace divorce = sum(divorce) by persnr (welle), sort: gen divorce1 = sum(divorce) by persnr (welle), sort: gen divorce2 = divorce1^2 // Models eststo clear eststo: xtreg lsat divorce welle, fe eststo: xtreg lsat divorce welle income unemp whours , fe eststo: xtreg lsat divorce1 divorce2 welle, fe eststo: xtreg lsat divorce1 divorce2 welle income unemp whours , fe esttab