Hi,
I'm trying to use both the survey package and the anesrake package to
perform raking on my sample dataset, to get the proportions to match up
with population data from the census.
I'm trying the following, but the resulting weights are very large:
> svy.unweighted <- svydesign(ids=~1, data=cleanPanelistData)
> svy.rake <- rake(design = svy.unweighted,
sample.margins = list(~age, ~education, ~ethnicity,
~gender, ~income, ~location, ~size),
population.margins = list(censusAge,
censusEducation, censusEthnicity, censusGender, censusIncome,
censusLocation, censusSize))
> summary(weights(svy.rake))
Min. 1st Qu. Median Mean 3rd Qu. Max.
133.9 567.6 1062.0 2606.0 2305.0 396800.0
When I use the anesrake package, the weights are capped at 5 and I'm able
to get a design effect of around 3.
My data set in .Rdata format is available here <http://we.tl/bUAuW3ajVs>
.
Am I doing something wrong? Should I be using calibrate with
calfun='raking' instead of rake?
This was run on:
RStudio on Mac Mavericks, version 3.02
with survey_3.30-3
thanks,
imran
[[alternative HTML version deleted]]