library(foreign) #install the package in the console! The package contains the function `read.dta` that is used to access the data
ml <- read.dta("https://stats.idre.ucla.edu/stat/data/hsbdemo.dta")10.12: Multinomial logistic regression
Learning objectives
Identify when to use a multinomial logistic regression model
Interpret a multinomial logistic regression model
Generate a multinomial logistic regression model in R
Classwise videos
If you have questions as you watch the videos, feel free to send me an email or slack message! I will address common questions at the beginning of class.
If you want to type the code as you follow along the lecture, you can use the following code to load the data:
Textbook
ISLR briefly covers multinomial logistic regression in section 4.3.5
Application exercise
Using the dataset from the lecture (code provided above to access), select your own predictors and fit, interpret, and assess a multinomial model. Select at least one categorical predictor and at least one continuous predictor (do not use only ses and write since those were the two used in the lecture).
Practice writing out the separate logistic models for each level of the outcome
Write interpretations for the coefficient estimates and 95% confidence intervals
Assess the model with the confusion matrix metrics
Generate the plot of the predicted probabilities