4.plot the residuals against each of the numeric predictors to check functional form. Are there any obvious trends? Increasing? Decreasing? Rainbow?
1.Residuals should be on the y-axis and numeric predictor on the x-axis.
2.No needto add nice labels for these, they are just diagnostic plots
3. add a horizontal line at 0 by using abline(h=0) after you make your plot.
4. Insert your plots below.
Both are approximately flat and so functional form is correct.
5. Make a normal qqplot, histogram and boxplot of the residuals to check normality.
to get a histogram type hist(fit$residuals), boxplot is boxplot(fit$residuals), and qqplot is either from the plot(fit) or type qqnorm(fit$residuals) and qqline(fit$residuals)
Paste all 3 plots here. Though there is one outlying residual and the ends of the qqplot aren't perfect. These are VERY normally distributed. Even more deviations from normality would be tolerated.
6. Find a 95% confidence interval for
β2.
(Hint: use summary(fit) to get the standard error. Then use the formula: estimate±SE*t to get the CI. The df for the t distribution will be n-4 because there are four parameters estimated).
7. Find a 90% confidence interval for the average value of rating when you have a clear soda that has a carbonation of 6.7 and sweetness of 3.3.
8. Find a 95% predictive interval for a new observation when you have a clear soda that has a carbonation of 6.7 and sweetness of 3.3.