4
I need to do a classifier with logistic regression to classify this categorical variable that can have 14 different values. Does anyone know if it is possible to do this with glm() or if I have to use another function (and which one)?
4
I need to do a classifier with logistic regression to classify this categorical variable that can have 14 different values. Does anyone know if it is possible to do this with glm() or if I have to use another function (and which one)?
4
By definition, logistic regression can only be used to adjust models where the answer is dichotomous: yes and no, success and failure, male and female.
A data set whose variable response is categorical with 14 different levels cannot have a logistic regression model adjusted to it. For this purpose, the Multinomial Regression (there is no entry on the wiki pt regarding this statistical model).
The R
is able to adjust a model of this type via the command multinom
:
library(nnet)
?multinom
However, these models are more complicated to interpret than logistic regression models. I suggest the book Categorical Data Analysis, by Alan Agresti, as a source of consultation. It is an excellent book in the theoretical and reasonably didactic part. He has at least one entire chapter devoted to the analysis of this type of model.
Also, 14 levels is a fairly high number of levels. I’ve never adjusted a multinomial model with that many levels. I do not know how such a model would behave or whether it would even be adjusted, because there may be problems of numerical stability. I imagine if the sample size is small, it’s possible that the Type II Error Rate increase, especially if estimators have high standard error.
Thank you very much! It’s a college paper where the teacher specified the types of analysis that he wanted us to do. I think I’ll send an email to him and confirm if that’s right. Thank you!
Browser other questions tagged r
You are not signed in. Login or sign up in order to post.
Here is a good article: http://www.ats.ucla.edu/stat/r/dae/mlogit.htm, for example
– Daniel Falbel