I had adjusted my survey data by age groups according to the 2010 US Census, but now I want to simultaneously adjust by sex. How would I go about creating the new standard age and sex adjusted weights?
For an example of how I calculated the age-adjusted weight variable, I will include my code below. I used an age variable with 7 age groups. I also included the survey command I used to calculate prevalence estimates of my outcome variable applying the standardized weights.
gen std_wgt10 = 0.220724 if age7cat==0
replace std_wgt10 = 0.171133 if age7cat==1
replace std_wgt10 = 0.185875 if age7cat==2
replace std_wgt10 = 0.178898 if age7cat==3
replace std_wgt10 = 0.124713 if age7cat==4
replace std_wgt10 = 0.070752 if age7cat==5
replace std_wgt10 = 0.047905 if age7cat==6
svy: mean cms ,stdize(age7cat) stdweight(std_wgt10)
For an example of how I calculated the age-adjusted weight variable, I will include my code below. I used an age variable with 7 age groups. I also included the survey command I used to calculate prevalence estimates of my outcome variable applying the standardized weights.
gen std_wgt10 = 0.220724 if age7cat==0
replace std_wgt10 = 0.171133 if age7cat==1
replace std_wgt10 = 0.185875 if age7cat==2
replace std_wgt10 = 0.178898 if age7cat==3
replace std_wgt10 = 0.124713 if age7cat==4
replace std_wgt10 = 0.070752 if age7cat==5
replace std_wgt10 = 0.047905 if age7cat==6
svy: mean cms ,stdize(age7cat) stdweight(std_wgt10)
Comment