beatrice-m
9/13/2017 - 2:07 AM

Multinomial logistic model

# Multinomial logistic model to explain laptop usage profile
library(nnet)
# Relevel the category with the most entries
df$Profile_Aruba_Laptop2 = relevel(df$Profile_Aruba_Laptop, ref = "-1")
# Multinomial model
multimodel = multinom(Profile_Aruba_Laptop2 ~  Year + Engineer + `LabStat Desktop`, data = df)
summary(multimodel)

# Odd ratios
exp(summary(multimodel)$coefficients)

z <- summary(multimodel)$coefficients/summary(multimodel)$standard.errors
# 2-tailed z test
p <- (1 - pnorm(abs(z), 0, 1)) * 2