HertieDataScience / SyllabusAndLectures

Hertie School of Governance Introduction to Collaborative Social Science Data Analysis
MIT License
37 stars 60 forks source link

Survey package, svydesign help #115

Open MarieAgosta opened 7 years ago

MarieAgosta commented 7 years ago

Hey all,

Trying to use the survey package command svydesign to make sure our data is properly weighted and has proper estimates.

screen shot 2016-11-21 at 4 44 31 pm

I tried the above, the survey design object seems okay then I try the logic and I keep getting the error of:

Error in svyglm.survey.design(vote_2012 ~ education + unemployed + female + : all variables must be in design= argument

I already set the variables=NULL because, from my understanding, that defaults it to using the data frame (e.g. - all of the variables) so I don't understand why it keeps telling me to specify the variables again...?

If someone could clue me in as to what I'm missing, I would greatly appreciate it.

Marie

christophergandrud commented 7 years ago

Hi @MarieAgosta have you tried specifying the variables explicitly with the variables argument? If so, what happens?