| variable | description |
|---|---|
| purch_rating | Purchase rating (sliding scale 0 to 100, with higher ratings indicating greater perceived likelihood of purchase) |
| price | Price presented for item (range £5 to £100) |
| ppt | Participant identifier |
| condition | Whether items are seen on a model or on a white background |
Reasoning about random effects
In this lab, you’ll apply the tools you saw in the lectures this week to the same three datasets you got to know in Week 1.
You’ll figure out how to model the grouping structure in each dataset in terms of random intercepts and random slopes (which, together, we refer to as random effects).
- Create a new .Rmd file for this week’s exercises.
- Save it somewhere you can find it again.
- Give it a clear name (for example,
dapr3_lab03.Rmd). - In the first code chunk, load the packages you’ll need this week:
tidyversestats(forxtabs())
Clothing
Read in the dataset located at https://uoepsy.github.io/data/dapr3_mannequin.csv and name it clothing.
RQ: Are people more likely to purchase clothing when they see it displayed on a model, and is this association dependent on item price?
Thirty participants were presented with a set of pictures of items of clothing, and rated each item how likely they were to buy it. Each participant saw 20 items, ranging in price from £5 to £100. 15 participants saw these items worn by a model, while the other 15 saw the items hanging against a white background.
From the Week 1 lab, here’s the key information about clothing:
- Outcome:
purch_rating - Predictors:
price,condition(and their interaction) - Randomly-varying grouping variable:
ppt
Write the R formula for the fixed effects part of this model (that is, the outcome and predictors, the y ~ x + z part, the kind of models you’ve done before in DAPR2).
🗂️ See Fixed effects flash card.
Now we’re looking at how each randomly-varying grouping variable relates to the model’s predictors. We want to know: for each randomly-varying grouping variable, do at least some of its levels appear with more than one distinct value of each of the model’s predictors?
Specifically, for clothing:
- Do at least some levels of
pptappear with more than one distinct value ofprice? - Do at least some levels of
pptappear with more than one distinct value ofcondition?
🗂️ See Identify possible random effects flash card.
Let’s bring all this information together to reason about the random effects in this dataset.
We know that every randomly-varying grouping variable requires a random intercept. For each of those grouping variables, ask yourself: can we additionally include random slopes over each of the model’s predictor(s) by that variable?
Specifically, for clothing, we know we need a random intercept by ppt.
- Can we also include a random slope over
pricebyppt? - Can we also include a random slope over
conditionbyppt?
These answers will be based on what you found in answer to Question 2.
Write out the complete R formula for this model, expanding on the fixed-effects-only model you wrote above by adding on the appropriate random effects.
🗂️ See Add random effects to a model formula flash card.
Monkey status
Read in the dataset located at https://uoepsy.github.io/data/msmr_monkeystatus.csv and name it monkey.
RQ: How is the social status of monkeys associated with their ability to solve problems, while controlling for the difficulty of the problem?
| variable | description |
|---|---|
| status | Social status of monkey (adolescent, subordinate adult, or dominant adult) |
| difficulty | Problem difficulty ('easy' vs 'difficult') |
| monkeyID | Monkey name |
| solved | Whether or not the problem was successfully solved by the monkey |
Researchers have given a sample of Rhesus Macaques various problems to solve in order to receive treats. Troops of Macaques have a complex social structure, but adult monkeys tend can be loosely categorised as having either a “dominant” or “subordinate” status. The monkeys in our sample are either adolescent monkeys, subordinate adults, or dominant adults. Each monkey attempted various problems before they got bored/distracted/full of treats. Each problems were classed as either “easy” or “difficult”, and the researchers recorded whether or not the monkey solved each problem.
From the Week 1 lab, here’s the key information about monkeystatus:
- Outcome:
solved - Predictors:
status,difficulty - Randomly-varying grouping variable:
monkeyID
Write the R formula for the fixed effects part of this model.
🗂️ See Fixed effects flash card.
Now we’re looking at how each randomly-varying grouping variable relates to the model’s predictors. We want to know: for each randomly-varying grouping variable, do at least some of its levels appear with more than one distinct value of each of the model’s predictors?
🗂️ See Identify possible random effects flash card.
Let’s bring all this information together to reason about the random effects in this dataset.
We know that every randomly-varying grouping variable requires a random intercept. For each of those grouping variables, ask yourself: can we additionally include random slopes over each of the model’s predictor(s) by that variable?
Write out the complete R formula for this model, expanding on the fixed-effects-only model you wrote above by adding on the appropriate random effects.
🗂️ See Add random effects to a model formula flash card.
Laughs
Read in the dataset located at https://uoepsy.github.io/data/lmm_laughs.csv and name it laughs.
RQ: How is the delivery format of jokes (audio-only vs. audio AND video) associated with differences in humour ratings?
| variable | description |
|---|---|
| ppt | Participant identification number |
| joke_label | Joke presented |
| joke_id | Joke identification number |
| delivery | Experimental manipulation: whether joke was presented in audio-only ('audio') or in audiovideo ('video') |
| rating | Humour rating chosen on a slider from 0 to 100 |
These data are simulated to imitate an experiment that investigates the effect of visual non-verbal communication (i.e., gestures, facial expressions) on joke appreciation. Ninety participants took part in the experiment, in which they each rated how funny they found a set of 30 jokes. For each participant, the order of these 30 jokes was randomised for each run of the experiment. For each participant, the set of jokes was randomly split into two halves, with the first half being presented in audio-only, and the second half being presented in audio and video. This meant that each participant saw 15 jokes with video and 15 without, and each joke would be presented with video roughly half of the time.
From the Week 1 lab, here’s the key information about laughs:
- Outcome:
rating - Predictors:
delivery - Randomly-varying grouping variables:
pptandjoke_label/joke_id(two forms of the same information; for simplicity we can just usejoke_id)
Write the R formula for the fixed effects part of this model.
🗂️ See Fixed effects flash card.
Now we’re looking at how each randomly-varying grouping variable relates to the model’s predictors. We want to know: for each randomly-varying grouping variable, do at least some of its levels appear with more than one distinct value of each of the model’s predictors?
🗂️ See Identify possible random effects flash card.
Let’s bring all this information together to reason about the random effects in this dataset.
We know that every randomly-varying grouping variable requires a random intercept. For each of those grouping variables, ask yourself: can we additionally include random slopes over each of the model’s predictor(s) by that variable?
Write out the complete R formula for this model, expanding on the fixed-effects-only model you wrote above by adding on the appropriate random effects.
🗂️ See Add random effects to a model formula flash card.
Interpreting LMM summary TODO
TODO choose one dataset that doesn’t have convergence issues and task w interpreting LMM summary