เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

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.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Generalized Linear Models in R

ดูคอร์ส

คำแนะนำการฝึกหัด

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

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Fit a a long format logistic regression
lr_1 <- ___
print(lr_1)
แก้ไขและรันโค้ด