In health surveys it is often of interest to standardize domains to have the same distribution of, eg, age as in a target population. The operation is similar to post-stratification, except that the totals for the domains are fixed at the current estimates, not at known population values. This function matches the estimates produced by the (US) National Center for Health Statistics.
svystandardize(design, by, over, population, excluding.missing = NULL)
survey design object
A one-sided formula specifying the variables whose distribution will be standardised
A one-sided formula specifying the domains within which the standardisation will occur
Desired population totals or proportions for the levels of combinations of variables in by
Optionally, a one-sided formula specifying variables whose missing values should be dropped before calculating the domain totals.
A new survey design object of the same type as the input.
National Center for Health Statistics http://www.cdc.gov/nchs/tutorials/NHANES/NHANESAnalyses/agestandardization/age_standardization_intro.htm
# NOT RUN {
## matches http://www.cdc.gov/nchs/data/databriefs/db92_fig1.png
data(nhanes)
popage <- c( 55901 , 77670 , 72816 , 45364 )
design<-svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC2YR, data=nhanes, nest=TRUE)
stdes<-svystandardize(design, by=~agecat, over=~race+RIAGENDR,
population=popage, excluding.missing=~HI_CHOL)
svyby(~HI_CHOL, ~race+RIAGENDR, svymean, design=subset(stdes, agecat!="(0,19]"))
# }
Run the code above in your browser using DataLab