5 Exercise 3: The taste of cheese
Context: This model might be considered for an experiment involving the chemical constituents of cheese and its taste. The dataset contains the concentrations of acetic acid, hydrogen sulphide (\(H_2S\)) and lactic acid, as well as a subjective taste score. It is of interest to investigate the effects of the different acids on the taste score.
Model: \(\mathbb{E}(Y_i) = \alpha + \beta x_i\), \(Var(Y_i) = \sigma^2\)
Data: cheese.csv
Columns:
Case - Number of sampleTaste - Taste scoreAcetic.Acid - Acetic acid concentrationH2S - \(H_2S\) concentrationLactic.Acid - Lactic acid concentrationRead in the data using
5.1 Exploratory analysis
TASK 4
Produce scatterplots of
Taste(\(y\)-axis) againstLactic.Acid(\(x\)-axis), andTaste(\(y\)-axis) againstH2S(\(x\)-axis).Now plot
Tasteagainst log(H2S), and against log(Lactic.Acid). The command inRto perform a natural logarithmic transform is, for example,log(H2S).Which of the 4 variables (
H2S, log(H2S),Lactic.Acid, log(Lactic.Acid)) seems best for describing a linear relationship withTaste?
Which of the four plots shows a straight/close-to-straight line similar to the line \(y=x\)?
5.2 Fitting a model with a transformation
Fit a linear regression (using the
lmcommand) withTasteas the response variable and the explanatory variable you selected from part (c). Make a note of the fitted model.Produce a plot with a line from your fitted model in (d) using the
ablinecommand.How well do you think the model and the data agree?