MATH 456 Quiz 04
Given on 2026-03-05
Suppose we have three numeric variables x, y, z and one
categorical/qualitative variable c, and with these, we fit two
models.
fit1 <- lm(y ~ x + z + I(x * x), data = df)
fit2 <- lm(y ~ x * z, data = df)
-
Write the fitted regression equation equation for each model above. Use
s, with subscripts starting at , for the coefficients. -
Which predictors do these two models not have in common?
-
For
fit1, what is the "slope" onx? Write mathematically, the derivative ofwith respect to x. -
For
fit1, does the change independent on a change in xdepend on the value ofz? -
Let
mx <- mean(df$x)andmz <- mean(df$z). Forfit1, writeRcode to approximate the change inybased on a one unit change inx. -
For
fit2, what is the "slope" onx? Write mathematically, the derivative ofwith respect to x. -
For
fit2, does the change independent on a change in xdepend on the value ofz? -
Let
mx <- mean(df$x)andmz <- mean(df$z). Forfit2, writeRcode to approximate the change inybased on a one unit change inx.