MATH 456 Quiz 05

Given on 2026-03-10

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

library(ggplot2)
suppressMessages(library(dplyr))
fit <- lm(y ~ g + h * x + I(z * z), data = df)
  1. Make a ggplot2 histogram of stanrdardized residuals.

  2. Make a ggplot2 scatter plot of stanardized residuals on yhat..

  3. If g has levels g1, g2 and h has levels h1, h2, h3, use predict to make a prediction from fit for an observation of g1 and h3 with x = 3 and y = 10.