Reverse instructional design- glm in R

Jul 27, 2014 • Easton White

Below is the first 6 records of a data set for miles per gallon (mpg) and a number of other variables for cars.

auto_data

1) In R, how would we correctly use glm() to run a generalized linear model with mpg as the response variable with explanatory variables: cylinders, displacement, and year. We also want to include an interaction term for displacement and year.

a) glm(mpg~cylinders + displacement + year, data=Auto)

b) glm(mpg~cylinders + displacement + year)

c) glm(mpg~cylinders + displacement*year, data=Auto)

c) glm(mpg~cylinders + displacement + horsepower + weight + year + origin, data=Auto)

2) What types of plots could we use to determine if we violated the assumptions of the generalized linear model?