* Respondent versus head in the Survey of Consumer Finances;
*Education of the respondent;
* education of the HH head, and categorical variable;
* 1=no high school diploma/GED, 2=high school diploma or GED;
* 3=some college,4=college degree;
if x8000=5 then education=x5901;else if x8000=1 then education=x6101;
if x8000=1 then edspouse=x5901;else if x8000=5 then edspouse=x6101;
eddif=education- edspouse;
if x8000=5 then gotcdeg=x5904; else if x8000=1 then gotcdeg=x6104;
if x8000=5 then hsdiploma=x5902; else if x8000=1 then hsdiploma=x6102;
IF gotcdeg EQ 1 THEN educ=4;
ELSE IF education GE 13 THEN educ=3;
ELSE IF (hsdiploma IN (1 2)) THEN educ=2;
ELSE educ=1;
if x8000=5 then cdegree=x5905; else if x8000=1 then cdegree=x6105;
if x8000=5 then respage=x14;else if x8000=1 then respage=x19; * age of the respondent;
if x8000=5 then respsex=x8021;else if x8000=1 then respsex=x103;
if x103=x8021 then samesex=1; else samesex=0;
if x8000=5 then relation=x8023;else if x8000=1 then relation=x105;
if x8000=1 then sprel=x8023;else if x8000=5 then sprel=x105;
if samesex=0 and respsex=2 then MFMMGMGF=1;
if samesex=0 and respsex=1 then MFMMGMGF=2;
if samesex=1 and respsex=2 then MFMMGMGF=4;
if samesex=1 and respsex=1 then MFMMGMGF=3;
if x8023=3 and respsex=1 then MFMMGMGF=5; *separated male;
if x8023=3 and respsex=2 then MFMMGMGF=6; *separated female;
if x8023=4 and respsex=1 then MFMMGMGF=7; *divorced male;
if x8023=4 and respsex=2 then MFMMGMGF=8; *divorced female;
if x8023=5 and respsex=1 then MFMMGMGF=9; *widowed male;
if x8023=5 and respsex=2 then MFMMGMGF=10; *widowed female;
if x8023=6 and respsex=1 then MFMMGMGF=11; *never married male;
if x8023=6 and respsex=2 then MFMMGMGF=12; *never married female;
if x8023=0 or x8023>6 then MFMMGMGF =-8;
*married versus.;
if samesex=0 and respsex=2 and relation=1 then hh_type =1; *mf;
if samesex=0 and respsex=1 and relation=1 then hh_type =2; *mm;
if samesex=0 and respsex=2 and relation=2 then hh_type =3; *pf;
if samesex=0 and respsex=1 and relation =2 then hh_type =4; *pm;
if respsex=1 and (relation in (3 4 5 6)) then hh_type =5; *single male;
if respsex=2 and (relation in (3 4 5 6)) then hh_type =6; *single female;
if samesex=1 and respsex=2 then hh_type =7; * gf;
if samesex=1 and respsex=1 then hh_type =8; *gm;
if x8023=0 or x8023>6 then hh_type =-8;
if hh_type=1 or hh_type=2 then hh=1; * married ;
if hh_type>6 or hh_type=3 or hh_type=4 then hh=2;
if hh=2 then partner=1;else partner=0; *new variable --- partner household note that we count same sex couples as partners even though they might now have legal status in some states, though they would not in terms of the federal income tax;
If hh_type=5 or hh_type=6 then hh=3;
If hh=3 then singhd=1;else singhd=0; * non-couple household;
if respsex=2 then respfem=1;else respfem=0;