Logistic Regression in R
Overview
The following how-to guides explore how to conduct logistic regression analyses in R. Whereas linear regression is employed when you a continuous dependent variable, logistic regression is use when the dependent variable is categorical. If the categorical takes one of two outcomes, then binary logistic regression one approach. If there are more than two outcomes then one could analyze the data with multinomial logistic regression or ordered multinomial logistic regression is the dependent variable is ordered.
Requirements
- Working installation of RStudio & R
- Packages:
- tidyverse
- MASS
- nnet
- mlogit
- broom
- brant
Topics covered
Logistic Regression Pt. 1 - One Predictor Variable
Logistic regression is a statistical technique to understand the relationship between categorical outcome variables and categorical or continuous predictor variables. Binary logistic regression can be used in situations where the outcome takes on one of two values, such as whether or not someone survived a hospital stay or whether or not a medical intervention was successful or not.
Logistic Regression Pt.2 - Two Predictor Variables & Casewise Diagnostics
In this guide we continue with logistic regression by adding a second predictor variable to our model, compare the model with one predictor to the model with two predictors, and finally inspect the model diagnostics.
Multinomial Logistic Regression
Multinomial regression can be thought of as an extension of logistic regression. In logistic regression, the dependent or outcome variable can take on one of two categorical values such as whether or not someone survived a stay at a hospital.