Announcements

Exam 2 is moved to Friday, July 9, and there is lab this Friday instead.

Reminder: project proposals are due on Friday, July 9 as well. Look to the Project website for more information. A Github repository for your project will soon be made.

Exercises

The dataset car_prices.csv contains attributes of cars offered for sale on cars.com in 20171.

car_prices <- read_csv("data/car_prices.csv")

Price and Mileage

Consider a regression model with the response price and a single predictor mileage.

Exercise 1

Create a scatterplot of price and mileage.

Exercise 2

Use appropriate functions in R to find the fitted model and display the results in tidy format. Write out the equation of the fitted model, then include a visualization of the linear model on the scatterplot from Exercise 1.

Exercise 3

Interpret the slope and intercept in the context of the problem.

Exercise 4

What is the predicted selling price of a car with 50,000 miles?

Exercise 5

Suppose my friend has a Honda Accord with 225,000 miles. Is it appropriate to use this model to make a prediction for the selling price? Why or why not?

Price and Type

Consider a regression model with the response price and the categorical predictor type (Accord, Maxima, Mazda6).

Exercise 6

Use appropriate functions in R to find the fitted model and display the results in tidy format. Write out the equation of the fitted model.

Exercise 7

Interpret the intercept and slope(s) in the context of the problem.

Exercise 8

How many terms are in the model for type? Is this equal to the number of car types in the data set? If not, briefly explain why the number of terms for type in the model differs from the number car types in the data set.

Exercise 9

How does the average price of Maximas compare to the average price of Accords?

Exercise 10

What are possible limitations of your two regression models?


  1. The data is from the Stat2Data R package.