I'm pretty new to R and still struggle with quite basic stuff. Perhaps someone can help with the following. I want to conduct a logistic regression using a reference category and basically don't know how.
When I started my project I read my dataset in with convert.factors=FALSE, so I've got no factors. However, to relevel a variable to use as a reference category, by my understanding the variable needs to be a factor in order to use this function? I converted away from factors to help with cleaning the variable, e.g i used an ifelse formula to remove -1 and -2 non-responses.
say I'm doing the following:
votemodel <- glm(vote ~ Constant + partymembership, data=bes, family=binomial())
Where party Membership has 4 categories and I would like the coefficients for each party reported separately as with a reference category.
Can any clever souls advise how I can do this?