ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Generalized Linear Models in R

Ver curso

Instrucciones del ejercicio

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

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Fit a a long format logistic regression
lr_1 <- ___
print(lr_1)
Editar y ejecutar código