Slopes and multiple regression
Previously, you used multiple intercepts to model the expected values for discrete groups. Now, you will model continuous predictor variables with slopes.
In particular, you will model gains in math test scores by building three different models.
The data, school_3_data, has been loaded for you.
Notes:
y ~ xis a shortcut fory ~ 1 + x(where1 +is the intercept in the model), and thus you can omit1 +in your formulas.- Multiple regression use a
+in the formula (e.g.,y ~ x_one + x_two). - Use the interaction shortcut syntax
y ~ x_one * x_twoso the testing software will correctly score your answer.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Hierarchical and Mixed Effects Models in R
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Use a linear model to estimate how math kindergarten
# scores predict math gains later
___