Session Ready
Exercise

Long-form logistic regression input

As you learned in the video, a binomial regression can take inputs in three different formats. The first requires data to be in "long" format and directly models each observation (e.g. a response of numeric 0/1 or a factor of yes/no):

  x    y
1 a fail
2 a fail
3 b success
4 b fail
...

In this format, the formula response predicted by predictor (or response ~ predictor in R's formula syntax) is used. During this exercise, you'll fit a regression using this format.

Instructions
100 XP
  • Fit a logistic regression using the data.frame data_long with y being predicted by x.
  • Save the output as lr_1.