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

Multiple intercepts

With multiple intercepts, predictor variable order become important if you want to estimate intercepts for one group. This is because R only estimates intercepts for the first predictor variable. All other predictor intercepts will contrast to a reference group within the factor.

In the previous exercise, you constructed a contrast matrix with one intercept with and without an intercept for each group. During this exercise, build a contrast matrix with two group variables and use the -1 option. Then, swap the order of the input variables. This allows you to see how order is important for the contrast levels.

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

Generalized Linear Models in R

ดูคอร์ส

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

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

# Create a matrix that includes color and then shape  
model.matrix(___)
แก้ไขและรันโค้ด