head(MU284strat)
library(survey)
# Survey design for stratified simple random sampling without replacement
dn <- if (packageVersion("survey") >= "4.2") {
# survey design with pre-calibrated weights
svydesign(ids = ~LABEL, strata = ~Stratum, fpc = ~fpc,
weights = ~weights, data = MU284strat,
calibrate.formula = ~-1 + Stratum)
} else {
# legacy mode
svydesign(ids = ~LABEL, strata = ~Stratum, fpc = ~fpc,
weights = ~weights, data = MU284strat)
}
Run the code above in your browser using DataLab