Homework 6 (Data Analysis Using R) Solution




  1. Copy your answer to each question AND the R code by which you reached your answer to a document. The answers should be correctly ordered.

Problem 1 (10 pts): The text le “auto.txt” is a data set containing information for 392 vehicles. It consists of 9 variables.

mpg: Miles per gallon

cylinders: Number of cylinders between 4 and 8

displacement: Engine displacement (cu. inches)

horsepower: Engine horsepower

weight: Vehicle weight (lbs.)

acceleration: Time to accelerate from 0 to 60 mph (sec.)

year: Model year (modulo 100)

name: Vehicle name

origin: Origin of car (American, European, and Japanese)

Complete following questions:

  1. (1 pt) We want to compare whether there is a mpg di erence for three di erent origin of cars. Which plot would best show that? Provide appropriate visual-ization.

  1. (3 pt) Now we want to check whether the mpg di erence for three di erent origin of cars is statistically signi cant. State null and alternative hypotheses. Check the populations have same variance and perform the one-way ANOVA. Make your nal conclusion based on the p-value.

  1. (2 pt) If the null hypothesis is rejected, perform Tukey’s Honestly Signi cant Di erence Test. Which di erences are statistically signi cant?

  1. (2 pt) Fit a multiple linear regression. Set mpg as response variable and horsepower, acceleration, and year as explanatory variables. Report the estimates of the intercept and coe cients for each explanatory variable.

  1. (1 pt) Interpret horsepower coe cient.

  1. (1 pt) Interpret year coe cient.