Adjust weights for target sample units that do not respond and are missing at random within categories. The missing at random assumption implies that their sample weight may be assigned to specific categories of units that have responded (i.e., have been sampled). This is a class-based method for non-response adjustment.
adjwgtNR(wgt, MARClass, EvalStatus, TNRClass, TRClass)
vector of weights for each sample unit that will be adjusted for non-response. Weights must be weights for the design as implemented. All weights must be greater than zero.
vector that identifies for each sample unit the category that will be used in non-response weight adjustment for sample units that are known to be target. Within each missing at random (MAR) category, the missing sample units that are not sampled are assumed to be missing at random.
vector of the evaluation status for each sample unit. Values must include the values given in TNRclass and TRClass. May include other values not required for the non-response adjustment.
subset of values in EvalStatus that identify sample units whose target status is known and that do not respond (i.e., are not sampled).
Subset of values in EvalStatus that identify sample units whose target status is known and that respond (i.e., are target and sampled).
Vector of sample unit weights that are adjusted for non-response and that is the same length of input weights. Weights for sample units that did not response but were known to be eligible are set to zero. Weights for all other sample units are also set to zero.
set.seed(5)
wgt <- runif(40)
MARClass <- rep(c("A", "B"), rep(20, 2))
EvalStatus <- sample(c("Not_Target", "Target_Sampled", "Target_Not_Sampled"), 40, replace = TRUE)
TNRClass <- "Target_Not_Sampled"
TRClass <- "Target_Sampled"
adjwgtNR(wgt, MARClass, EvalStatus, TNRClass, TRClass)
#> [1] 0.0000000 1.0531091 1.4091418 0.4370921 0.0000000 1.0774517 0.8114191
#> [8] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.4893536 0.0000000
#> [15] 0.0000000 0.0000000 0.0000000 1.3645626 0.0000000 1.2943413 1.3897962
#> [22] 0.0000000 0.3299456 0.0000000 0.0000000 0.0000000 0.6828898 0.0000000
#> [29] 0.0000000 1.4909182 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
#> [36] 0.0000000 0.0000000 0.9333714 0.6208610 0.0000000
# function that has an error check