Here comes a probably very easy question about how to apply a weight variable in R.
I use the ANES 2013 Internet Recontact Survey dataset. Here I have the variable weight, which must be used in order to generalize to population.
My question is very simple: How do I apply the weight for logistic regression?
My best guess will be:
fit.gov.trust <-glm(gov.trust ~ party.contact:weight, family=binomial(link="logit"))
But I am not sure at all.
This can be done using the R survey
package by Thomas Lumley, specifically svyglm {survey}
The home page below provides a nice introduction:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.