Practical 11
Leaderboard | |||
---|---|---|---|
Rank | Name | Attempt | Time |
Loading leaderboard… |
The story is moderately thriller-themed, with mentions of being knocked out, abduction, small spaces, and mild threat. There are also some sound effects (e.g., ambient noises, evil laughter, music). There are NO flashing lights, jumpscares, or gruesome or graphic content of any kind.
If this is fine by you, we recommend you view this page in a full-size window with the sound on for the best gameplay experience. Don’t do it on your phone, it won’t look great.
If you’d rather not risk it, you can do the usual vanilla worksheet instead.
To complete this escape room, you will need access to RStudio and an Internet connection. Before you begin, make sure you open RStudio and open a new script or RMarkdown file (whichever you prefer). You will need to do the actions and analyses described in each task in R to complete the escape room successfully.
The tasks focus on data wrangling, interpreting relationships between variables, and understanding the linear model. You can solve the tasks in any way you like, using whatever code you’re familiar with. You are welcome (and encouraged) to use the resources available to you to solve the tasks, but keep in mind that the clock is ticking!
If you are playing in a team online, only one person should have the escape room page open. Beginning the escape room on different computers will generate different answers.
You have limited time to break free from the escape room.
Using a hint will incur a 10 minute penalty. Once you have accessed a hint, you can view it as many times as you like without further time penalty.
For closing the escape room tab, or refreshing the page, you will lose 20 minutes. This will happen every time.
Welcome to our experiment. We’re going to have such an interesting time together.
You should probably get started. Time is already slipping away, and you have a lot of work to do…
As soon as you cross the doorway, the door shuts behind you. A breathless moment later, the small room is lit by glaring fluorescent light. The only thing in the small room is a desk with an even more ancient computer on the table, its input line blinking expectantly. The door on the opposite wall, behind the computer, is locked.
Looking down, you’re not very surprised to see that your laptop now shows the familiar panels of RStudio. Then, a link appears on the screen with brief instructions.
# READ IN DATA
escape_df_iii <- read_csv("https://and.netlify.app/docs/escape/data/set_iii.csv")
Fingers tingling, you copy the link into RStudio and read in the data.
As you view it, it immediately becomes clear that the data is a mess. You’ll need to clean it up a bit before you can proceed. As if in response to your thought, instructions again appear:
condition
THEN ENTER ALL NUMBERS TO TWO DECIMAL PLACES IN THIS ORDER
VALUE 1: MINIMUM VALUE OF stats_anx
VALUE 2: MEAN OF trait_anx
VALUE 3: SD OF fear_tech
VALUE 4: MAXIMUM VALUE OF solve_time
VALUE 5: TOTAL NUMBER OF CASES REMAINING
First, remember to load any packages you need to use with library()
right from the beginning!
You can solve the tasks with any code you like.
You may find it useful to filter
out cases with NA
s, and to summarise
your n
s after you group_by
the variable of interest.
It may help to refer to Practical 4.
Remember that you can easily get help with function just by typing a question mark before a function in the Console, or using help()
.
Finally, you must enter ALL of the numbers to two decimal places - even if you just have to add 0s at the end!
You’ve passed the first test, but there’s a long way to go.
Where are you headed next? How do you proceed from here? You need to a direction to move forward if you want to leave.
You carry the laptop through to the next room, and you’re no longer surprised when the door shuts itself behind you. This time, when the light flickers on, the room is entirely empty, with only a door opposite and a row of dials and a switch set into the wall next to it.
Direction, is it? Distantly, you recall learning about how pairs of variables can have directionality - either positive or negative relationships. Maybe that will help you here.
solve_time
AND fear_tech
stats_anx
AND trait_anx
courage
AND stats_anx
fear_tech
AND trait_anx
solve_time
AND courage
Any method you like to find out the direction of the relationship between each pair of variables will do.
For example, a scatterplot of pairs of variables might help you visualise each relationship, or you can use what you know about cor
relation to quantify the relationships numerically.
It may help to refer to Tutorial 5…
You have direction now, but we all need relationships to get through hard times.
Which relationships are strongest, and best? Which will emerge victorious?
Stepping through from the dial room, you find yourself in yet another empty room - or, mostly empty. This one has a large dent in the left wall from some strong impact, and on the floor beneath lies another laptop, like the one in your hands, with a smashed screen. It looks like someone before you lost their patience. Or perhaps someone lost their patience with the person before you…
Another small table, this one with a single sheet of paper and a scanner. The paper has five questions on it. On cue, instructions appear on your laptop screen.
NULL MODEL:
OUTCOME solve_time
ONLY
MODEL 1:
OUTCOME solve_time
PREDICTORS courage
, fear_tech
MODEL 2:
OUTCOME solve_time
PREDICTORS courage
, fear_tech
, stats_anx
, trait_anx
Round all numeric values to 2 decimal places.
Does model 1 explain significantly more variance than the null model?
What is the F-statistic for this comparison (model 1 vs null model)?
Does model 2 explain significantly more variance than the model 1?
What is the F-statistic for this comparison (model 2 vs model 1)?
Which model best explains the variance in the outcome?
First, construct all three linear models and save them each in a new object.
Remember that you can easily add more predictors into the model by literally adding them (+
)!
It may help to refer to Tutorial 9.
Then, compare the models to each other to find out whether each model is a significant improvement over the previous one.
Just looking at each model individually won’t work – you’ll need to think of anova
way!
Maybe Tutorial 11 will give you a clue.
What excellent progress you’re making. We hope it hasn’t taken you too long. The clock is ticking…
None of us can predict the future, but we can estimate it. If you wish to escape, you will have to estimate very well indeed.
You’re getting close to the end, for better or worse. You glance nervously at the battery on the laptop as the frantic whirring of the fan kicks to high gear. Better hurry!
You shake your head to clear it and focus instead on the door ahead of you and the worn keypad set into the wall next to it. Once again, instructions flash on the screen. You frown as more instructions appear and swallow a sudden lump in your throat – it’s maths…
OUTCOME solve_time
PREDICTORS courage
, fear_tech
, stats_anx
, trait_anx
THEN ESTIMATE solve_time
WITH FOLLOWING VALUES
courage
= , fear_tech
= , stats_anx
= , trait_anx
= courage
= , fear_tech
= , stats_anx
= , trait_anx
= courage
= , fear_tech
= , stats_anx
= , trait_anx
= First, create the model – or just use the one from the previous task.
Then, you will need to get the b values from the output and use them to construct a linear model equation. Remember the format of the linear model is:
\(y = b_0 + b_1x_1 + b_2x_2 + ... + b_nx_n\)
Use your output to replace all bs with their values and all xs with variable names. Make sure you have replaced all bs with their correct (unrounded) values from the output. It may help to refer to Practical 10.
Then, for each set of values, replace the placeholder names of the variables with the given values. There’s a quick way to do this in Tutorial 10.
If you’re really stuck, it may help to remember that “largest” isn’t the same as “largest absolute value” for negative numbers!
Humans look for patterns in noise and order in chaos. This last pattern is your last task.
Quick now! You are so close.
As you enter the dark room, the light that winks on above is different than the fluorescent bars before. A projector is set into the wall above your head, and bright on the opposite wall is the output for the linear model, larger than life. Stepping closer, you can see the faint outline of a concealed door behind the wall – and marks, some from hands, other from pounding fists.
Its fan whirring shrilly, your trusty laptop gives you the final set of instructions.
solve_time
solve_time
WHEN ALL PREDICTORS = 0solve_time
Call:
lm(formula = ~ + + + , data = )
Residuals:
Min 1Q Median 3Q Max
Coefficients:
Estimate Std. Error t value Pr(>|t|)
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: on degrees of freedom
Multiple R-squared: , Adjusted R-squared:
F-statistic: on and DF, p-value:
Remember that you can only compare effects based on standardised coefficients!
How awful that you have to get them yourself…
You blink several times in confusion as your eyes adjust. You’re back in the waiting room, which is as deserted as ever, and the light that seemed so bright a moment before is just the grey afternoon light coming through the too-small windows. The first patter of raindrops hit the glass.
Not knowing what else to do, you set the laptop down on the table where you found it. Your stomach rumbles; you should hurry home. What time is it? Did any of that really happen?
As you head out the door, you throw one last glance back at the laptop. A single message remains on the screen for just a moment before it goes dark:
SEE YOU SOON
If you’d like your result to be recorded for the leaderboard, fill in the form below.
The data you enter are not managed by the University of Sussex. Instead, they are stored in a private spreadsheet on Google Drive. We only collect your name, time, and attempt for the purpose of the leaderboard. IP address is NOT recorded
Only enter your real name and surname if you are happy with these terms and conditions.
Well done!
Creepy story, data and task design
Jennifer Mankin
Implementation, sound mixing, annoying whistling
Milan Valášek
Sound effects adapted from freesound.org with special thanks to:
Code for countdown timer adapted from an article by Mateusz Rybczonek
Old computer in Task 1 heavily inspired by a great article by Edwin