title: “Homework Assignment 4”
(a)In this dataset, which predictors are qualitative, and which predictors are quantitative?
Copyright By PowCoder代写 加微信 powcoder
year, origin, and name are qualitative, rest predictors are quantitative
(b)Fit a MLR model to the data, in order to predict mpg using all of the other predictors except for
name. For each predictor in the fitted MLR model, comment on whether you can reject the null hypothesis.
p value is smaller than 0.05, we reject the null hypothesis that that there is no linear association between that predictor and mpg
(c)Indicate clearly how the coefficient estimates associated with the predictor origin should be
interpreted.
cylinder:there is a negative relationship with mpg
displacement:there is a positive relationship with mpg
horsepower:there is a negative relationship with mpg
weight:there is a negative relationship with mpg
acceleration:there is a positive relationship with mpg
Here the factor level 70 for year and 1 for origin are the base level, which is 0, rest are in the summary(mod)
(d)What mpg do you predict for a Japanese car with three cylinders, displacement 100, horsepower
of 85, weight of 3000, acceleration of 20, built in the year 1980?
the predict mpg of this car is 30.86473 miles per gallon
(e)On average, holding all other predictor variables fixed, what is the difference between the mpg of
a Japanese car and the mpg of an European car?
(f) Fit a model to predict mpg using origin and horsepower, as well as an interaction between origin
and horsepower. Present the summary output of the fitted model, and write out the fitted linear model.
(g) Following the previous question: On average, how much does the mpg of a Japanese car change
with a one-unit increase in horsepower?
for a Japanese car, id horsepower increase by 1 unit, then mpg will increase by -0.121320-0.108723=-0.230043.
(h). (2 pts) If we are fitting a polynomial regression with mpg as the response variable and weight as the
predictor, what should be a proper degree of that polynomial?
(i)Perform a backward selection, starting with the full model which includes all predictors except for name. What is the best model based on the adjusted R2 criterion? What are the predictor variables in that best model?
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com