I have some survey data and would like to address non-reponse bias by raking on 3 demographic variables for which I have decent population estimates from the American Community Survey.
The problem I am running into is that a few of the surveys are missing responses on one or more of the demographic variables (for example one survey is missing the 'Annual Household Income' entry and I am trying to rake on 'Annual Household Income'), and so these entries are NAN in the data.frame.
So far when I try to rake with a call like
csr_raked = rake(design=csr_design,
sample.margins=list(~Stratum+Annual_HHI),
population.margins = list(HHI_marginals))
where I am simply trying to rake on a single variable, I get the following error message:
Error in postStratify.survey.design(design, strata[[i]], population.margins[[i]], :
Strata in sample absent from population. This Can't Happen
From reading the anesrake
documentation it looks like the anesrake
package can handle this type of issue, so I thought that the survey
package would as well and I just don't know how to tell it to (I would prefer to perform all analysis using a single package if possible).
anesrake
documentation says what it does in this setting? $\endgroup$anesrake
package by the author which can be found here: web.stanford.edu/group/iriss/cgi-bin/anesrake/resources/… The relevant text is at the bottom of page 6 in the Missing Data section. $\endgroup$rake
than insidecalibrate
, though it might be a pain for standard error estimation $\endgroup$