In: Statistics and Probability
Please use R or Rstudio for this exercise and show everything, including the R output. Pay attention in everything in Bold, please.
" The quality of Pinot Noir wine is thought to be related to the properties of clarity, aroma, body, flavor, and oakiness. Data for 38 wines are given in stat5_prob1.
(a) Fit a multiple linear regression model relating wine quality to these regressors.
(b) Construct the ANOVA table.
(c) Test for the significance of the regression in a 0.05 significance level. What conclu- sions can you draw?
(d) Use the t tests to assess the individual contribution of each regressor to the model in a 0.05 significance level. Discuss your findings.
(e) What is the contribution of the set of clarity and aroma to the model, given that all of the other regressors are included? Perform this hypothesis test using 0.05 significance level.
(f) Find a 95% confidence interval for the regression coefficient for flavor.
(g) Calculate R^2 and R^2 adj for this model. Compare these values to the R^2 and R^2 adj for the regression model relating wine quality to aroma and flavor. Discuss your results.
***Here is the data for the 38 wines***
# quality is y
# clarity is x1, aroma is x2, body is x3, flavor is x4, oakiness is
x5.
y=c(9.8, 12.6, 11.9, 11.1, 13.3, 12.8, 12.8, 12, 13.6, 13.9, 14.4, 12.3, 16.1, 16.1, 15.5, 15.5, 13.8, 13.8, 11.3, 7.9, 15.1, 13.5, 10.8, 9.5, 12.7, 11.6, 11.7, 11.9, 10.8, 8.5, 10.7, 9.1, 12.1, 14.9, 13.5, 12.2, 10.3, 13.2)
x1=c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.5, 0.8, 0.7, 1, 0.9, 1, 1, 1, 0.9, 0.9, 1, 0.7, 0.7, 1, 1, 1, 1, 1, 1, 1, 0.8, 1, 1, 0.8, 0.8, 0.8, 0.8)
x2=c(3.3, 4.4, 3.9, 3.9, 5.6, 4.6, 4.8, 5.3, 4.3, 4.3, 5.1, 3.3, 5.9, 7.7, 7.1, 5.5, 6.3, 5, 4.6, 3.4, 6.4, 5.5, 4.7, 4.1, 6, 4.3, 3.9, 5.1, 3.9, 4.5, 5.2, 4.2, 3.3, 6.8, 5, 3.5, 4.3, 5.2)
x3=c(2.8, 4.9, 5.3, 2.6, 5.1, 4.7, 4.8, 4.5,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