R/national.SMART.R
national.SMART.Rd
Add SMART flags to a stratified sample survey (e.g. MICS, DHS, national SMART)
national.SMART(x, strata, indices = c("haz", "whz", "waz"))
x | Survey dataset (as an R data.frame) with indices present |
---|---|
strata | Name of column in |
indices | Names of columns in |
A data.frame with same structure as x
with a flagSMART
column added. This column is coded using sums of powers of two
# Use the national.SMART() function to flag indices from a national # SMART survey in Nigeria (flag.ex03) svy <- flag.ex03 svyFlagged <- national.SMART(x = svy, strata = "state") # Exclude records with flagging codes relevant to whz: svyFlagged <- svyFlagged[!(svyFlagged$flagSMART %in% c(2, 3, 6, 7)), ]