treatment | wpm |
---|---|
control | 109.43 |
control | 113.83 |
control | 113.22 |
control | 110.46 |
control | 116.23 |
control | 113.12 |
Contrasts
Learning Objectives
At the end of this lab, you will:
- Understand how to specify contracts to test specific effects.
- Understand different types of study design.
What You Need
Required R Packages
Remember to load all packages within a code chunk at the start of your RMarkdown file using library()
. If you do not have a package and need to install, do so within the console using install.packages(" ")
. For further guidance on installing/updating packages, see Section C here.
For this lab, you will need to load the following package(s):
- tidyverse
- psych
- kableExtra
- emmeans
Lab Data
You can download the data required for this lab here or read it in via this link https://uoepsy.github.io/data/caffeinedrink.csv
Study Overview
Research Question
Does WPM differ by caffeine treatment condition?
To investigate if the number of words typed per minute (WPM) differs among caffeine treatment conditions, the researchers conducted an experiment where participants were randomly allocated to one of four treatment conditions. Two of these conditions included non-caffeinated drinks - control (water) and mint tea, and the other two caffeinated drinks - coffee and red bull.
Drink | Caffeine | Temp |
---|---|---|
Control (Water) | No | Cold |
Red Bull | Yes | Cold |
Coffee | Yes | Hot |
Mint Tea | No | Hot |
In addition to the above research question, the researchers were also specifically interested in the following comparisons:
- Whether having some kind of caffeine (i.e., red bull or coffee), rather than no caffeine (i.e., control - water or mint tea), resulted in a difference in average WPM
- Whether there was a difference in average WPM between those with hot drinks (i.e., mint tea / coffee) in comparison to those with cold drinks (control - water / red bull)
Setup
- Create a new RMarkdown file
- Load the required package(s)
- Read the caffeinedrink dataset into R, assigning it to an object named
caffeine
Firstly, examine the dataset, and perform any necessary and appropriate data management steps.
Secondly, set an appropriate reference group based on the research question.
Formally state:
- a linear model to investigate whether there are differences in WPM based on caffeine treatment conditions
- your chosen significance level
- the null and alternative hypotheses
Provide a table of descriptive statistics and visualise your data.
Remember to interpret your plot in the context of the study (i.e., comment on any observed differences among treatment groups).
Fit the specified model, and assign it the name “caf_mdl1”.
Examine and describe the coefficients in the output of summary()
before interpreting the \(F\)-test results from anova()
in the context of the ANOVA null hypothesis.
Formally state the two planned comparisons that the researchers were interested in as testable hypotheses.
After checking the levels of the factor treatment
, use emmeans()
to obtain the estimated treatment means and uncertainties for your factor.
Specify the coefficients of the comparisons and run the contrast analysis. Obtain 95% confidence intervals, and then interpret your results in relation to the researchers hypotheses.
Study Design
For each of the below experiment descriptions, note (1) the design, (2) number of variables of interest, (3) levels of categorical variables, (4) what you think the reference group should be and why.
A group of researchers were interested in whether sleep deprivation influenced reaction time. They hypothesised that sleep deprived individuals would have slower reaction times than non-sleep deprived individuals.
To test this, they recruited 60 participants who were matched on a number of demographic variables including age and sex. One member of each pair (e.g., female aged 18) was placed into a different sleep condition - ‘Sleep Deprived’ (4 hours per night) or ‘Non-Sleep Deprived’ (8 hours per night).
A group of researchers were interested in replicating an experiment testing the Stroop Effect.
They recruited 50 participants who took part in Task A (word colour and meaning are congruent) and Task B (word colour and meaning are incongruent) where they were asked to name the color of the ink instead of reading the word. The order of presentation was counterbalanced across participants. The researchers hypothesised that participants would take significantly more time (‘response time’ measured in seconds) to complete Task B than Task A.
You can test yourself here for fun: Stroop Task
A group of researchers wanted to test a hypothesised theory according to which patients with amnesia will have a deficit in explicit memory but not implicit memory. Huntingtons patients, on the other hand, will display the opposite: they will have no deficit in explicit memory, but will have a deficit in implicit memory.
To test this, researchers designed a study that included two variables: ‘Diagnosis’ (Amnesic, Huntingtons, Control) and ‘Task’ (Grammar, Classification, Recognition) where participants were randomly assigned to a Task condition. The first two tasks (Grammar and Classification) are known to reflect implicit memory processes, whereas the Recognition task is known to reflect explicit memory processes.