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)
  1. Write the fitted regression equation equation for each model above. Use s, with subscripts starting at , for the coefficients.

  2. Which predictors do these two models not have in common?

  3. For fit1, what is the "slope" on x? Write mathematically, the derivative of with respect to x.

  4. For fit1, does the change in dependent on a change in x depend on the value of z?

  5. Let mx <- mean(df$x) and mz <- mean(df$z). For fit1, write R code to approximate the change in y based on a one unit change in x.

  6. For fit2, what is the "slope" on x? Write mathematically, the derivative of with respect to x.

  7. For fit2, does the change in dependent on a change in x depend on the value of z?

  8. Let mx <- mean(df$x) and mz <- mean(df$z). For fit2, write R code to approximate the change in y based on a one unit change in x.