datavisdev
datavisdev

Reputation: 13

How should you use scaled weights with the svydesign() function in the survey package in R?

I am using the survey package in R to analyse the "Understanding Society" social survey. The main user guide for the survey specifies (on page 45) that the weights have been scaled to have a mean of 1. When using the svydesign() function, I am passing the weight variable to the weight argument.

In the survey package documentation, under the surveysummary() function, it states:

Note that the design effect will be incorrect if the weights have been rescaled so that they are not reciprocals of sampling probabilities.

Will I therefore get incorrect estimates and/or standard errors when using functions such as svyglm() etc?

This came to my attention because, when using the psrsq() function to get the Pseudo R-Squared of a model, I received the following warning:

Weights appear to be scaled: rsquared may be wrong

Any help would be greatly appreciated! Thanks!

Upvotes: 1

Views: 1049

Answers (1)

Thomas Lumley
Thomas Lumley

Reputation: 2765

No, you don't need to worry

The warning is only about design effect estimation (which most people don't want to do), and only about without-replacement design effects (DEFF rather than DEFT). Most people don't need to do design-effect estimation, they just need estimates and standard errors. These are fine; there is no problem.

If you want to estimate the design effects, R needs to estimate the standard errors (which is fine) and also estimate what the standard errors would be under simple random sampling without replacement, with the same sample size. That second part is the problem: working out the variance under SRSWoR requires knowing the population size. If you have scaled the weights, R can no longer work out the population size.

If you do need design effects (eg, to do a power calculation for another survey), you can still get the DEFT design effects that compare to simple random sampling with replacement. It's only if you want design effects compared to simple random sampling without replacement that you need to worry about the scaling of weights. Very few people are in that situation.

As a final note surveysummary isn't a function, it's a help page.

Upvotes: 1

Related Questions