Data Carpentry’s aim is to teach researchers basic concepts, skills, and tools for working with data so that they can get more done in less time, and with less pain. This lesson was designed for researchers interested in working with public health data in R, but may be of interest to researchers in other fields as well.
This lesson provides an introduction to binary logistic regression. This model has a binary outcome variable, i.e. a variable that can only take one of two values. The episodes in this lesson cover binary response variables, the uses and equation of logistic regression, fitting and evaluating logistic regression models with one continous explanatory variable, making predictions and assessing model fit and assumptions.
Getting started
To get started, see the instructions in the Setup page. There you will learn how to obtain the data and packages used in this lesson.
Prerequisites
This lesson does not require a formal background in statistics.
This lesson requires:
- Working copies of R and RStudio. See here for installation instructions.
- An understanding of how to use the Tidyverse packages to summarise and manipulate data in RStudio. See these episodes on data handling and data manipulation.
- An understanding of how to use the ggplot2 package to plot data in RStudio. See this episode on data visualisation.
- An understanding of the concepts covered in the Statistical thinking for public health and Simple linear regression for public health lessons.