Any NA target frequencies in w8margin are imputed using the
percentage distribution in observed, from svytable(~observed, Ntotal = 1, ...).
The percentage is multiplied by the desired target sample size. For example,
if has a target of NA and a desired total sample of 1500, and the
observed frequency of the weighting variable is 0%, the imputed target will
be (10% * 1500). If a weights argument is provided, then weighted
percentage distributions are used; this may be useful when design weights are
present, or when first raking on variables with complete targets.
If rebase == TRUE (the default), targets for non-NA categories
are scaled down so that the total target frequency (sum(w8margin$Freq, na.rm = TRUE))
remains constant, after imputing new category targets. If rebase == FALSE,
targets for non-NA categories remain constant, and the total target frequency
will increase.
There is an important theoretical distinction between missing targets
for conceptually valid categories, versus missing observed data due to
non-response or refusal. It is only conceptually appropriate to impute targets
if the targets themselves are missing. When handling missing observed data,
multiple imputation techniques (such as mice::mice()) will often
produce better results, except when missingness is closely related to
weighting variable (technically referred to as "missing not at random").