I've been working on some survey data using the survey
package. I read the documentation available on post-stratification and calibration, however I got stuck trying to calibrate the sampling weights on a total known for the population that is not the population total.
To make my self clear I prepared an example: Let's say I have income information for a sample stratified by sex, which lets me create the svydesign
object:
data = data.frame(id = c(1:5),
sex = c("F","F","F","C","C"),
income = c(100,150,75,200,100),
sw = c(2,2,3,3,3))
dis = svydesign(ids = ~id,
strata = ~ sex,
weights = ~sw,
data = data)
Then I can calculate the total income by sex with:
svyby(~income,~ sex,dis,svytotal)
gender income se
F F 725 90.13878
M M 900 300.00000
However, I don't know how many males or females are in the population but I do know total income by sex:
gender income
F 800
M 800
I haven't been able to find a way of using the calibrate
or postStratify
functions to get this estimations of the totals by sex correctly with the se = 0 (i.e. calibrating(post-stratifying) a survey design with a total different from the total population by group).
I know I could calibrate the sampling weights by multiplying by the ratio calibration factor (dividing the estimated total over the population known total by sex). This approach has some limitations as stated here, since I would get the point estimations right but not the standard errors.
Thanks in advance for reading this! Any suggestions would be appreciated. :)