MATH 456 Quiz 06

Given on 2026-03-12

Suppose you have numeric variables x, y and a categorical variable g, from a data frame named df, and with this data set, you fit the following model.

fit <- lm(y ~ g * x + g:I(x * x), data = df)
summary(fit)

The coefficients output from this model are

Coefficients:

(Intercept)
g2
x
g2:x
g1:I(x * x)
g2:I(x * x)
  1. Using s, starting with , write the fitted regression equation based on the model above.

  2. Describe this model in words.

  3. Write math that would make a prediction from this model for a g2 with x = 10.

  4. Write R code to make a prediction from this model for a g2 with x = 10.