# What goes wrong with post-stratification if a combination of values does not exist in the sample? How to fix it?

This question is both about the "survey" package in R and about the mechanics behind it. I'm more interested in the mechanical reasons why this package fails to create weights when combinations of values are missing in the sample.

So my specific problem is this: I have a survey that I would like to post-stratify on age and gender. Since the sampling procedure was difficult, I don't have values for each age-gender combination (gender is coded as binary and age has 5-year brackets). When I use the rake function to post-stratify my sample, I receive the error message Some strata absent from sample: use partial=TRUE to ignore them. and when I use partial=TRUE, I receive the error message unused argument (partial = TRUE). I did some research, and found here that this is the expected behavior. I assume that the program runs into problems when calculating weights for observations that don't occur. Is this assumption correct?

Does this mean that post-stratification isn't possible?

What would be a work-around for such a case?

The best you can hope do to is match the population stratum distribution for strata that are present in the sample, and that's what partial=TRUE asks for.
One scenario where partial=TRUE makes sense is when your sample deliberately doesn't contain some strata, so you really are doing post-stratification on a subset of strata. Another is when you were just unlucky in sampling, so you are trying to do post-stratification to the whole population, but it won't work very well.