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.
You’re free to use whatever R commands you want for completing the tasks, unless instructed differently. Extra points will be awarded for the use of efficient commands (e.g., piping), elegant solutions, and pretty plots. However, keep in mind that if you script a fancy code or plot and it doesn’t work, the task (and all following tasks) will be awarded 0 points. Bottom line: manage your time wisely.
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 | Points |
---|---|
Task 1 | 1 |
Task 2 | 2 |
Task 3 | 3 |
Task 4 | 4 |
Task 5 | 3 |
Task 6 | 3 |
Task 7 | 3 |
Task 8 | 2 |
Task 9 | 3 |
Task 10 | 4 |
Extra | 2 |
At the end of exam, save your final R file as LastName_studentID.R in this folder. Make sure the file has the correct extension.
Read the dataset into R, and assign the name data to it
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.
Assign the variables in your dataset as following:
Create a Gender factor and add it to the dataset.
Using mutate () or its combinations, create a Response variable from RT and add it to the dataset.
Using the dplyr() function, create a new dataset data_sum that has mean and standard deviation 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.
Run an ANOVA with RT as dependent measure and mode as within-subject factor.
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.
Let’s include gender as between subject variable and rerun the ANOVA.
You may see a similar error message as in 7). You can move onto the next task and consider Task 8 successfully completed, provided the results of the ANOVA are shown.
Following what you have done for task 8, run an independent t-test to investigate the effect of gender on RT. In addition, calculate Cohen’s d for this comparison.
Edit the data dataset so to have RT for Manual and Automated Modes into 2 separate columns.
For task 7, you had the following message shown:
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.
Revise the dataset and re-run the function you scripted for task 7 so R won’t show you any error message.