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)
-
Using
s, starting with , write the fitted regression equation based on the model above. -
Describe this model in words.
-
Write math that would make a prediction from this model for a
g2withx = 10. -
Write
Rcode to make a prediction from this model for ag2withx = 10.