The final exam is worth 30% of your final grade. The exam consists of a progression of tasks with increasing difficulty. Different tasks are worth different points.
If you successfully complete a task, you will receive full points for that task and may move onto the next task.
If you don’t complete a task, or you have errors in your script or output, or R shows warning messages, you will receive 0 points to the current and all following tasks (unless stated otherwise). Hence, make sure to successfully complete each task before moving to the next one.
For the successful completion of this test, you may use your lecture notes, old R scripts, and, of course, all of your other friends: Google, Stackoverflow, cheat sheets and so forth and so on. However, note that relevant University of Windsor policies on academic misconduct still applies, hence you are not allowed to communicate with other students. If you have any questions, contact me by sending me a message in the course’s Teams chat, and I will respond at soon as I can.
You’re free to use whatever R commands you want for completing the tasks, unless instructed differently.
Disclaimer: This file is property of the University of Windsor. Do not share this file.
You are a great scientist (congrats!). Sir Richard Branson heard about your great success and wants to pay you a ton of money to run a study to investigate the effect of automation on spacecraft pilots’ performance. In short, Richard is interested in understanding whether or not using automation will improve pilots’ performance.
The data from the experiment that you just finished running is saved in a csv file and is available here.
The dataset is organized as following:
Below are the tasks included in the exam, each with the numbers of points assigned to them.
Task | Task 1 | Task 2 | Task 3 | Task 4 | Task 5 | Task 6 | Task 7 | Task 8 | Task 9 | Task 10 |
Points | 1 | 2 | 4 | 4 | 3 | 3 | 4 | 2 | 4 | 3 |
At the end of exam, submit your final R file as LastName_studentID.R in Blackboard under Final Exam. Make sure the file has the correct extension.
Read the dataset into R, and assign the varibles as following:
Note that for this particular task you will need to set a directory which is unique for your machine and local folder. That’s totally fine. When grading, I will change the directory in your script back to a different directory on my machine. However, make sure to assign a name to your dataset and always reference that dataset (or derivate datasets) throughout the script, and never reference the original csv file again in your script.
Create the factor Gender and add it to the dataset.
Create the factor Age and add it to the dataset. This factor has three levels: young, mid, old.
Using mutate () or its combinations, create a Response variable from RT and add it to the dataset.
Summarize the dataset to create data_sum that has mean, standard deviation and standard error of RT broken down by mode and gender. All nonnumeric values may need to be removed.
Utilize data_sum to create a histogram with:
Assign the name myPlot to it.
Complete 7.1 and 7.2
A few important things to keep in mind:
Warning: Collapsing data to cell means. *IF* the requested effects are a subset of the full design, you must use the "within_full" argument, else results may be inaccurate.
If you see this or a similar message together with the results of the ANOVA, that’s fine and you can move on to the following task. Make sure the results of the ANOVA are shown though.
You might see a similar error message as in 7.1. If so (and even if you don’t) move onto the next task and consider this task successfully completed, provided the results of the ANOVA are shown.
Following what you have done for task 7.2, run an independent t-test to investigate the effect of gender on RT. In addition, calculate Cohen’s d for this comparison.
Turn the data dataset from a long format to a wide format so to have RT for Manual and Automated Modes into 2 separate columns. Your new dataset should look like the one in the image below.
Dataset in the Wide format
You run a survey study where you ask 30 participants, with different ages and genders, five questions each: Q1, Q2, Q3, Q4, Q5. Participants answer the five questions on a scale from 1 to 7. When importing the data into an Excel file, you do so by using a wide format. Unbeknownst to you, however, your adviser is fervently against using wide formats. So, before you present your work to them, you decide to quickly change the dataset from wide to long.
Access the dataset here, and turn it into a long format before your adviser finds out.
Here is what your dataset looks like now:
Here is what your dataset will look like later:
Long