Thirty samples of cheddar cheese were analyzed for their content of acetic acid,
ID: 3207959 • Letter: T
Question
Thirty samples of cheddar cheese were analyzed for their content of acetic acid, hydro-gen sulde and lactic acid. Each sample was tasted and scored by a panel of judges and the average tast score produced. Use the cheddar data in package faraway to answer the following:
• (a) Fit a regression model with taste as the response and the three chemical contents as predictors. Report the values of the regression coecients.
• (b) If H2S is increased 0.01 for the tted model, what change in the taste wouldbe expected?
• (c) Calculate R2 and adjusted R2 for this model.
(in R package ”faraway”, you will need to install the package in R)
Explanation / Answer
The complete R snippet is as follows
library("faraway")
# read the data
data<-cheddar
# fit the model using lm with taste as the dependent variable
fit<- lm(taste~., data = data)
# get the summary of the model
summary(fit)
The results are
> summary(fit)
Call:
lm(formula = taste ~ ., data = data)
Residuals:
Min 1Q Median 3Q Max
-17.390 -6.612 -1.009 4.908 25.449
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -28.8768 19.7354 -1.463 0.15540
Acetic 0.3277 4.4598 0.073 0.94198
H2S 3.9118 1.2484 3.133 0.00425 **
Lactic 19.6705 8.6291 2.280 0.03108 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 10.13 on 26 degrees of freedom
Multiple R-squared: 0.6518, Adjusted R-squared: 0.6116
F-statistic: 16.22 on 3 and 26 DF, p-value: 3.81e-06
The regression coefficients are
> fit$coefficients
(Intercept) Acetic H2S Lactic
-28.8767696 0.3277413 3.9118411 19.6705434
so this means that for a unit change in h2s taste would increase by 3.911 units , so for a 0.01 increase in h2s the taste would increase by 3.911*0.01= 0.03911 units
Hope this helps
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.