Question
In this question we analyse the effect of sugar content and chocolate type on the flavour of chocolate chip cookies. The variables we consider are
In this question we analyse the effect of sugar content and chocolate type on the flavour of chocolate chip cookies. The variables we consider are summarised in the table below.
Name | Type | Description |
numerical | flavour rating of cookie: 1-10 | |
factor | sugar content: 0 (0.5 cups), 1 (0.375 cups), 2 (0.25 cups) | |
factor | chocolate type: 1 (milk), 2 (semi-sweet), 3 (dark) |
The sample data consists of 11 observations of for each combination of levels of and (data available in lab4.csv on Canvas) for a total of 99 observations.
The statistical model for this experiment is
where
- is flavour rating of the -th cookie with and
- is global mean
- is the treatment effect on of
- is the treatment effect on of
- is the interaction effect on of and
- is the random effect on of -th cookie with and
The components of the factorial design are:
- factor A - sugar content (variable ) which has 3 levels: 0 (0.5 cups), 1 (0.375 cups), 2 (0.25 cups)
- factor B - chocolate type (variable ) which has 3 levels: 1 (milk), 2 (semi-sweet), 3 (dark)
- treatments - the 9 combinations of levels of the factors
- experimental units - the 9 groups of 11 cookies each prepared with a different treatment
- measurement units - the 99 cookies used in the experiment
- response variable - flavour rating (variable ).
Note that the response variable is a discrete variable, so we know it cannot be normally distributed. Irrespective of this, we will apply-tests to the data and determine from the residual analysis whether application of these tests seems appropriate.
Plots
To start we produce some boxplots of by levels of factors and and combinations of these.
The first chart show the between-treatment variation is dominated by the within-treatment variation, so it is not clear from the chart whether the factorwill turn out to have a statistically-significant effect on. Similar comments can be made about the second chart and the effect of the factoron.
The third chart does show some large between-treatment variation for some combinations of levels of factorsand, so it appears likely that a significant interaction effect between these factors will be found.
We can investigate interaction effects using the interaction plots below.
The non-parallel trace lines in both plots suggest the interaction between factors could be significant.
- Referring to the interaction plots above, rank the average flavour ratings of cookies made with the 3 types of chocolate using 0.5 cups of sugar
ANOVA and F-tests
Perform two-factor ANOVA (with interaction) and associated F-tests to determine the significance of the two factors.
- Using significance level , document the interaction term F-test from the two way ANOVA. Write down the null and alternative hypotheses, the test statistic and associated p-value, the test decision (with reason) and a conclusion using a minimum of mathematical language
- Consider again the interaction -test from (b). Write down R code that takes as input the interaction test statistic and returns the p-value
Tukey post hoc analysis
From the results of the F-tests we know that both factors are significant, as is their interaction. Now we perform post-hoc analysis for each factor. Due to the interaction term, we need to do this for each level of the other factor.
- Using significance level , perform Tukey post-hoc analysis for factor by each level of . Summarise the findings
- Using significance level , perform Tukey post-hoc analysis for factor by each level of . Summarise the findings
Assumptions
The conclusions drawn from the -tests rely on certain assumptions being satisfied.
- Using diagnostic plots, determine if the assumptions of normality, independence and constant variance appear to have been metand from this decide if the conclusions drawn in (b)-(e) are sound
- Using significance level , test if the residuals are normally distributed. Write down the null and alternative hypotheses, the test statistic and associated p-value, the test decision (with reason) and a conclusion using a minimum of mathematical language
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started