Home > Net >  R survey logistic regression with multiple levels in response/dependent variable
R survey logistic regression with multiple levels in response/dependent variable

Time:12-08

I have been using the R survey package to run multivariable logistic regressions (multiple independent variables, both categorical and continuous, with some of the categorical variables having multiple levels).

I am using the svyglm function.

Is it possible to use the same method if the dependent variable has multiple levels that are ordered, i.e. A < B < C < D < E? What about unordered? Right now, my dependent variable only has two levels (i.e. 0 and 1). If ordered is possible, do I need to convert them into integers?

Thank you!

CodePudding user response:

For an ordered polychotomous DV, you would want ordinal logistic regression, which is available in the MASS package (see MASS::polr()). For an unordered DV, you’d want multinomial regression, available in the nnet package (see nnet::multinom()).

And no, you wouldn’t convert your ordered DV to integers; you would create an ordered factor like this:

df$var1 <- ordered(df$var1, levels = c("A", "B", "C", "D", "E"))

CodePudding user response:

For dependent variables that are categorical where order matters (for example, trying to predict what star rating a movie will receive on a 5-star scale where 1 is the worst and 5 is the best), you will want to run an Oridinal Logistic Regression model - also sometimes called a Proportional Odds model.

Keith McNulty has written a great explanation of this, with tutorials in R! It has a walkthrough example of how to set up your model, as well as how to interpret the results: https://peopleanalytics-regression-book.org/ord-reg.html

When the dependent variable is unordered and there are more than two possible outcomes, you will want to run a mulitnomial regression model, found here: https://peopleanalytics-regression-book.org/multinomial-logistic-regression-for-nominal-category-outcomes.html

If your categories are unordered but you ONLY have two possible outcomes, you will want to run a binary logistic regression: https://peopleanalytics-regression-book.org/bin-log-reg.html

  •  Tags:  
  • r
  • Related