Be sure to check the solutions to last week’s exercises.
You can still ask any questions about previous weeks’ materials if things aren’t clear!
LEARNING OBJECTIVES
Do distracting colours influence game completion time?
A group of students wanted to answer the above research question. To do so, they designed a standard computerized game and a second version with distracting colours. Time to completion and type of game played were recorded for each study participant. See the data description below for more information.
Read the Perfection game data into R and name the data frame perfection
.
Check for the correct encoding of all variables — that is, categorical variables should be factors and numeric variables should be numeric.
Identify the units, the population to which conclusions can be generalised to, the explanatory variable and the response variable. Also classify the variables according to their type.
Is this study an experiment or an observational study?
Display and describe the marginal distribution of game type.
Display and describe the marginal distribution of completion times.
Display and describe the relationship between game type and completion times.
Does it look like the groups have equal mean or spread? Are there any extreme observations?
The researchers hope to determine if distracting colours could impact response times when playing a computerised version of the Perfection game.
Using a two-sided alternative, write out in words and in symbols appropriate null and alternative hypothesis for the research question of interest.
Using the t.test()
function, perform a statistical test against the null hypothesis specified above.
Using the linear model function, lm()
, fit the following linear model to the Perfection game data:
\[
Time = \beta_0 + \beta_1 \ Type + \epsilon
\]
Write down the equation of the fitted line.
At the 5% significance level, are the regression coefficients significantly different from zero?
Does the model explain a significant fraction of the variability in completion times?
Do you notice any similarities between the results of the two-sample t-test (performed via t.test()
) and those of the linear model fitted via lm()
?
Interpret the intercept and slope of the fitted regression model.
The test statistics reported in the model results are based on a series of assumptions. If these assumptions are not satisfied, the results will not hold.
You can remember the four assumptions by memorising the acronym LINE:
If at least one of these assumptions does not hold, say N - Normality, you might be reporting a LIE.
Check if the fitted model satisfies the linearity assumption.
Hint: An equivalent way to assess this is to check that the errors have a mean of zero. That is, there is no pattern left in the residuals as the systematic trend has entirely been captured by the linear model.
Check if the fitted model satisfies the independent errors assumption.
Check if the fitted model satisfies the normality of the errors assumption.
Check if the fitted model satisfies the equal variance assumption.
Perfection is a popular game in which a person is expected to place an assortment of shaped pegs into the matching spaces.↩︎