national.SMART {nipnTK} | R Documentation |
Add SMART flags to a stratified sample survey (e.g. MICS, DHS, national SMART)
Description
Add SMART flags to a stratified sample survey (e.g. MICS, DHS, national SMART)
Usage
national.SMART(x, strata, indices = c("haz", "whz", "waz"))
Arguments
x |
Survey dataset (as an R data.frame) with indices present |
strata |
Name of column in |
indices |
Names of columns in |
Value
A data.frame with same structure as x
with a flagSMART
column added. This column is coded using sums of powers of two
Examples
# 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)), ]
[Package nipnTK version 0.2.0 Index]