1 Initialize R

options(contrasts=c("contr.sum","contr.poly")) # IMPORTANT!
load(file=url('http://pnb.mcmaster.ca/bennett/psy710/datasets/L4-learning.rda'))

The options command sets up R to define ANOVA effects using the sum-to-zero constraint.

Answer all of the following questions and submit your answers as a script file on Avenue 2 Learn. Make sure to begin your script file with the following lines:

# PSYCH 710 Lab 4 Homework
# Script File
# SEP-2023
# Your Name: <<Your name here>>
# Student ID: <<Your ID here>>
# Collaborators: <<Names of your collaborators here>>

Also, make sure that text that is not an R command is preceded by a comment symbol (#). For example, you can insert questions or comments among your commands like this:

# The following command doesn't work... not sure why...
# ttest(x=g1,y=g2) # was trying to do a t test

2 Perceptual Learning Experiment

Performance in most perceptual and cognitive tasks improves with practice, but it remains unclear how precisely how performance changes as a function of practice. Theory 1 holds that improvement is a linear function of the number of practice trials. Theory 2 holds that learning is an accelerating non-linear function of practice (see Figure 1).

Figure 1. Hypothetical effects of practice on performance.

Figure 1. Hypothetical effects of practice on performance.

An experiment examined the effect of the number of practice trials on response accuracy in a pattern identification task. Participants completed a practice session on Day 1 and a test session on Day 2. The number of practice trials varied across groups; all participants the same number of test trials on Day 2. The dependent variable was response accuracy (proportion correct) on Day 2; the independent variable was the number of practice trials on Day 1. The data are stored in the data frame learning which contains the ordered factor trials, which indicates the number of practice trials, and the numeric variable, accuracy, which holds response accuracy on Day 2.

sapply(learning,class)
## $trials
## [1] "ordered" "factor" 
## 
## $accuracy
## [1] "numeric"
summary(learning)
##  trials      accuracy     
##  t10:25   Min.   :0.0100  
##  t20:25   1st Qu.:0.2654  
##  t30:25   Median :0.4012  
##  t40:25   Mean   :0.4097  
##  t50:25   3rd Qu.:0.5671  
##  t60:25   Max.   :0.8849

2.1 Questions

When answering the following questions, you may use an alpha of 0.05 and assume (unless stated otherwise) that the data satisfy the assumptions of normality and homogeneity of variance.

  1. Plot average response accuracy as a function of practice trials.

  2. Use ANOVA to examine the effect of practice trials on response accuracy. Your answer should include the ANOVA table and a conclusion regarding the null hypothesis evaluated by the omnibus \(F\).

  3. Calculate a measure of effect size and association strength for trials.

  4. Explain why the results of your ANOVA do not distinguish between Theories 1 and 2.

  5. Present the results of a linear contrast (or several contrasts) that might help you distinguish Theories 1 and 2. You may assume that these contrasts are planned.

  1. Re-evaluate your contrasts assuming that you decided to perform them after looking at the data.