This link from UCLA.edu (https://stats.idre.ucla.edu/r/dae/multinomial-logistic-regression/) provides a useful example for a multinomial logistic case. However, I wonder how can I correctly interpret the coefficients in case of grouped data. Here is an example following the ucla.edu exercise:
# Load packages require(foreign) require(nnet) require(ggplot2) require(reshape2) # Read data from ucla.edu ml <- read.dta("https://stats.idre.ucla.edu/stat/data/hsbdemo.dta") str(ml) # $ prog : Factor w/ 3 levels "general","academic","vocation": 3 1 3 3 3 1 3 3 3 3 ... # $ write : num 35 33 39 37 31 36 36 31 41 37 ... # $ ses : Factor w/ 3 levels "low","middle","high": 1 2 3 1 2 3 2 2 2 2 ...
NOTE: I wish to predict variable
prog using the numeric variable
write and the 3 level factor
ses. I don't care if the 3 levels, "low", "middle", "high", are ordered! As far as I am concerned this factor can be gender or country or whatever.
# Choose the baseline level of 'prog' dependent variable ml$prog2 <- relevel(ml$prog, ref = "academic")
I run a simple model based only on 'write' independent variable (I.V.)
test1 <- multinom(prog2 ~ write, data = ml) summary(test1) # I get the following coefficients Coefficients: (Intercept) write general 2.712485 -0.06600782 vocation 5.359000 -0.11780909
I run the complex model, including 'ses' factor as the second I.V.
test2 <- multinom(prog2 ~ write + ses, data = ml) summary(test2) # I get the following coefficients Coefficients: (Intercept) write sesmiddle seshigh general 2.852198 -0.0579287 -0.5332810 -1.1628226 vocation 5.218260 -0.1136037 0.2913859 -0.9826649
So, how can I directly get the intercepts for each level of
ses? I am not interested in the change of intercept from one level to another.
I tried this:
test3 <- multinom(prog2 ~ write + ses -1, data = ml) summary(test3)
which is interpreted by R as omitting the 'main' intercept
Coefficients: write seslow sesmiddle seshigh general -0.05792787 2.852149 2.318866 1.689318 vocation -0.11360180 5.218146 5.509562 4.235464
As I see, the intercept of model
test2 is actually the coefficient of level
low of factor
ses in model
test3 (the first level in alphabetical order).
So, now, can I make the interpretations like this:?
The log odds of being in general program vs. in academic program will increase by 2.85 for
ses=low, by 2.32 for
ses=middle and by 1.69 for
ses=high. In a similar way for the log odds of being in vocation program vs. in academic program: the increase will be by 5.22 for
ses=low, by 5.51 for
ses=middle and by 4.24 for
Sorry if my question might look naive.