Multiple slopes
You learned about model.matrix() and its relationship to glm() during the video. Now, you can "peek under the hood" of R and see how formulas work. The input to model.matrix() is similar to formula inputs of lm() and glm() with one key difference: model.matrix() does not have a left-hand side (e.g. y ~), only the right-hand side (e.g., ~ x).
For example, model.matrix( ~ x1) or model.matrix( ~ x1 + x2) both would be valid inputs. The output from model.matrix() is called a prediction matrix because it is the prediction (or right-hand side) of a formula in R.
During this exercise, you will use model.matrix() with 2 vectors: size and count.
First, build a simple formula that only includes size.
Second, build a formula that includes both size and count.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Generalized Linear Models in R
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Use model.matrix() with size
___