* Encoding: UTF-8.
*Use the ESS6 dataset.
FREQ hhmmb.
COUNT malehhn=gndr gndr2 gndr3 gndr4 gndr5 gndr6 gndr7 gndr8 gndr9 gndr10 gndr11
gndr12 gndr13 gndr14 gndr15 gndr16 gndr17 gndr18 gndr19 gndr20 gndr21 gndr22 gndr23
gndr24(1).
VARIABLE LABELS malehhn "N males in Household".
FREQ malehhn.
COUNT femhhn= gndr to gndr24 (2).
VARIABLE LABELS femhhn ‘N females in Household’.
freq femhhn.
COUNT gndrdkr= gndr to gndr24 (7 9).
VARIABLE LABELS gndrdkr ‘N DK/Refuse gndr in Household’.
freq gndrdkr.
Compute totalhhn =malehhn + femhhn + gndrdkr.
FREQ totalhhn
Cross totalhhn by hhmmb.
DO REPEAT Y=yrbrn to yrbrn24 / A=A1 to A24.
COMPUTE A = (inwyys - Y).
END REPEAT print.
COUNT infanthhn = a1 to a24 (0 thru 4).
COUNT childhhn = a1 to a24 (5 thru 14).
COUNT wagehhn = a1 to a24 (15 thru 64).
COUNT oldhhn = a1 to a24 (65 thru hi).
COUNT noage = yrbrn to yrbrn24 (7777,8888, 9999).
VARIABLE LABELS infanthhn “N children 0-4 in HH” childhhn “N children 5-14 in HH”
wagehhn “N adults 15-64 in HH” oldhhn “N adults 65+ in HH” noage “N no age data in HH”.
FREQ infanthhn to noage.
COUNT norelative = rshipa2 to rshipa24 (6).
FREQ norelative.
COMPUTE onlynonrel = 0.
IF (hhmmb gt 1) and (norelative gt 0) and ((hhmmb - norelative) = 1 ) onlynonrel eq 1.
FREQ onlynonrel.
COUNT partners = rshipa2 to rshipa24 (1) /
offspring = rshipa2 to rshipa24 (2) /
parents = rshipa2 to rshipa24 (3) /
sibs = rshipa2 to rshipa24 (4).
VARIABLE LABELS partners “N partner of R” offspring “N (step)children of R in HH”
/ parents “N parents(in-law) of R in HH”
/ sibs “N (step)siblings of R in HH”.
FREQ parents to sibs.
FREQ rshipa2 to rshipa24
/FORMAT=NOTABLE
/STATISTICS=MIN.
COMPUTE partdob eq 9999.
IF (rshipa2 = 1) partdob = yrbrn2.
IF (rshipa3 = 1) partdob = yrbrn3.
IF (rshipa4 = 1) partdob = yrbrn4.
IF (rshipa5 = 1) partdob = yrbrn5.
IF (rshipa6 = 1) partdob = yrbrn6.
IF (rshipa7 = 1) partdob = yrbrn7.
IF (rshipa8 = 1) partdob = yrbrn8.
IF (rshipa9 = 1) partdob = yrbrn9.
RECODE partdob (sysmis = 9999).
MISSING VALUES partdob (9999).
FREQ partdob.
COMPUTE pgndr eq 9999.
IF (rshipa2 = 1) pgndr = gndr2.
IF (rshipa3 = 1) pgndr = gndr3.
IF (rshipa4 = 1) pgndr = gndr4.
IF (rshipa5 = 1) pgndr = gndr5.
IF (rshipa6 = 1) pgndr = gndr6.
IF (rshipa7 = 1) pgndr = gndr7.
IF (rshipa8 = 1) pgndr = gndr8.
IF (rshipa9 = 1) pgndr = gndr9.
RECODE pgndr (sysmis = 9999).
MISSING VALUES pgndr (9999).
FREQ pgndr.
COMPUTE youngest = min(A1 to A24).
VAR LABELS youngest 1 ”age of youngest hh member”.
FREQ youngest.
COMPUTE agediff = (yrbrn-partdob).
FREQ agediff.
USE ALL.
COMPUTE filter_$=(partners gt 1).
FILTER BY filter_$.
LIST VARS = cntry idno yrbrn gndr hhmmb partdob agediff yrbrn2 to yrbrn6 rshipa2 to rshipa6
gndr2 to gndr6.
IF (country =5) and (idno = 194) rshipa4 = 2.
IF (country =5) and (idno = 1032) rshipa3 = 2.
IF (country =10) and (idno = 1283) rshipa4 = 2.
IF (country =10) and (idno = 2252) rshipa4 = 2.
IF (country =15) and (idno = 41772) rshipa3 = 2.
IF (country =16) and (idno = 2264) rshipa3 = 2.
IF (country =18) and (idno = 2965) rshipa3 = 2.
IF (country =18) and (idno = 3126) rshipa4 = 2.
IF (country =20) and (idno = 602015) rshipa3 = 2.
IF (country =25) and (idno = 2282) rshipa3 = 2.
IF (country =25) and (idno = 2417) rshipa4 = 2.
IF (country =25) and (idno = 2850) rshipa3 = 2.
IF (country =27) and (idno = 201409) rshipa5 = 2.
IF (country =29) and (idno = 288) rshipa3 = 2.
IF (country =18) and (idno = 2464) rshipa3 = 2.
IF (country =18) and (idno = 2464) rshipa4 = 2.
IF (country =29) and (idno = 1401) rshipa4 = 88.
IF (country =11) and (idno = 111851) yrbrn2 = 1979.
IF (country =14) and (idno = 10212) yrbrn2 = 8888.
IF (country =29) and (idno = 1210) yrbrn2 = 1979.
IF (country =29) and (idno = 1542) rshipa7 = 2.
IF (country =6) and (idno = 4224) rshipa7 = 99.
IF (country =6) and (idno = 4224) rshipa8 = 99.
COMPUTE flag eq 0.
IF ((childhhn ge 1) and (partners ge 1) and (offspring ge 1)) flag = 1.
IF ((infanthhn ge 1) and (partners ge 1) and (offspring ge 1)) flag = 1.
VAR LABELS flag 0 “other” 1 “child 0-14yrs & partner of R in HH”.
FREQ flag.
COMPUTE dualearn = 9.
IF ((flag = 1) and (pdwrk = 1) and (pdwrkp = 1)) dualearn = 1.
IF ((flag = 1) and (gndr = 1) and (pdwrk = 1) and (pdwrkp = 0)) dualearn = 2.
IF ((flag = 1) and (gndr = 2) and (pdwrk = 0) and (pdwrkp = 1)) dualearn = 2.
IF ((flag = 1) and (gndr = 2) and (pdwrk = 1) and (pdwrkp = 0)) dualearn = 3.
IF ((flag = 1) and (gndr = 1) and (pdwrk = 0) and (pdwrkp = 1)) dualearn = 3.
IF ((flag = 1) and (pdwrk = 0) and (pdwrkp = 0)) dualearn = 4.
VALUE LABELS dualearn 1 "both work" 2 "man works" 3 "woman works" 4 "neither works"
9 "NA".
MISSING VALUES dualearn (9).
FREQ dualearn.
weight by pspwght.
cross cntry by dualearn
/CELLS= row.