/*Exercise: A Comparison of Stylized and Diary Reports of Meal Preparation among Same-Sex and Different-Sex Couples*/ /*how many completed module?*/ tab eh_resp; /*keep married only*/ keep if spousepres==1 | spousepres==2; /*keep eh module only*/ keep if eh_resp==1; /*num partnered*/ tab spousepres; /*differentiate same sex vs different sex*/ gen samesex=(sex==spsex); /*num same sex and by sex*/ tab samesex; tab sex samesex; gen resp_coupletype=1 if sex==1 & samesex==1; replace resp_coupletype=2 if sex==1 & samesex==0; replace resp_coupletype=3 if sex==2 & samesex==1; replace resp_coupletype=4 if sex==2 & samesex==0; /*remove missings from foodshop*/ gen r_mealprep=mealprep if mealprep<96; /*generate row percentages*/ svyset [weight=ehwt]; svy: tab resp_coupletype r_mealprep, row; /*generate mean time use by couple type*/ svy: mean foodprep, over(resp_coupletype);