Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Two-Way ANOVA Analysis of Age and Processing Effects on Memory - Prof. Rhonda R. Decook, Study notes of Statistics

An analysis of the 'age.mem.data' dataset using a two-way anova model to investigate the effect of age and processing (counting, rhyming, adjective, imagery, intentional) on memory performance. Code for data manipulation, plotting, and statistical testing.

Typology: Study notes

Pre 2010

Uploaded on 03/19/2009

koofers-user-0oa
koofers-user-0oa 🇺🇸

4

(1)

10 documents

1 / 3

Toggle sidebar

Related documents


Partial preview of the text

Download Two-Way ANOVA Analysis of Age and Processing Effects on Memory - Prof. Rhonda R. Decook and more Study notes Statistics in PDF only on Docsity! 22s:152 Applied Linear Regression Chapter 8: Two-Way ANOVA ———————————————————— • Example: A balanced two-way ANOVA with significant interaction – Age/Memory Data – One theory regarding memory is that ver- bal material is remembered as a function of how thorughly it was processed when it was initially presented. – Variables: Words Number of words out of 27 remembered Age Factor: Younger/Older Process Factor: 1 of 5 learning groups Eysenck, M. W. (1974). Age di!erences in incidental learning. De- velopmental Psychology, 10, 936-941. 1 Learning groups (or levels) of Process factor: Counting group (lowest level of processing) Rhyming group Adjective group Imagery group (deepest level of processing) Intentional group (told they would have to recall the words, others were not) > levels(Age) [1] "Older" "Younger" > levels(Process) [1] "Adjective" "Counting" "Imagery" "Intentional" "Rhyming" ## Re-order Process levels appropriately: > Process=factor(Process,levels=c("Counting","Rhyming", "Adjective","Imagery","Intentional") > levels(Process) [1] "Counting" "Rhyming" "Adjective" "Imagery" "Intentional" 2 > interaction.plot(Process,Age,Words) 6 8 1 0 1 2 1 4 1 6 1 8 Process m e a n o f W o rd s Counting Rhyming Adjective Imagery Intentional Age Younger Older A more sophisticated plot: Process W o rd s 5 1 0 1 5 2 0 Counting Rhyming Adjective Imagery Intentional O O O O O O O Y Y Y Y Y Y Y Y Y O O OOO O O O O Y Y Y Y Y Y Y Y Y O O O O O O O O O Y Y Y Y Y Y YY Y Y OO O O O O O O O Y YY Y Y Y Y Y Y Y O O O O O O O O OO Y Y Y Y Y Y YY Y Y 3 Coding for more sophisticated plot: plot(c(0.75,5.25),range(Words),type="n",xlab="Process",ylab="Words", axes=F,cex.lab=1,cex.axis=1) axis(2) axis(1,at=1:5,levels(Process)) box() points(jitter(rep(1,10),factor=2.5), jitter(Words[Process==levels(Process)[1] & Age=="Older"],factor=2.5),pch="O",col=1,cex=1.5) points(jitter(rep(1,10),factor=2.5), jitter(Words[Process==levels(Process)[1] & Age=="Younger"],factor=2.5),pch="Y",col=2,cex=1.5) points(jitter(rep(2,10),factor=2.5), jitter(Words[Process==levels(Process)[2] & Age=="Older"],factor=2.5),pch="O",col=1,cex=1.5) points(jitter(rep(2,10),factor=2.5), jitter(Words[Process==levels(Process)[2] & Age=="Younger"],factor=2.5),pch="Y",col=2,cex=1.5) points(jitter(rep(3,10),factor=2.5), jitter(Words[Process==levels(Process)[3] & Age=="Older"],factor=2.5),pch="O",col=1,cex=1.5) points(jitter(rep(3,10),factor=2.5), jitter(Words[Process==levels(Process)[3] & Age=="Younger"],factor=2.5),pch="Y",col=2,cex=1.5) points(jitter(rep(4,10),factor=2.5), jitter(Words[Process==levels(Process)[4] & Age=="Older"],factor=2.5),pch="O",col=1,cex=1.5) points(jitter(rep(4,10),factor=2.5), jitter(Words[Process==levels(Process)[4] & Age=="Younger"],factor=2.5),pch="Y",col=2,cex=1.5) points(jitter(rep(5,10),factor=2.5), jitter(Words[Process==levels(Process)[5] & Age=="Older"],factor=2.5),pch="O",col=1,cex=1.5) points(jitter(rep(5,10),factor=2.5), jitter(Words[Process==levels(Process)[5] & Age=="Younger"],factor=2.5),pch="Y",col=2,cex=1.5) means=tapply(Words,list(Process,Age),mean) lines(c(1,2,3,4,5),means[,1],col=1) lines(c(1,2,3,4,5),means[,2],col=2) 4 • Example: Age/Memory data > nrow(age.mem.data) [1] 100 > table(Process,Age) Age Process Older Younger Counting 10 10 Rhyming 10 10 Adjective 10 10 Imagery 10 10 Intentional 10 10 > means=tapply(Words,list(Process,Age),mean) > means Older Younger Counting 7.0 6.5 Rhyming 6.9 7.6 Adjective 11.0 14.8 Imagery 13.4 17.6 Intentional 12.0 19.3 This is a balanced two-way ANOVA. 5 Before fitting the linear model, we will change our dummy regressor coding to the sum-to- zero constraint. > contrasts(Process) Rhyming Adjective Imagery Intentional Counting 0 0 0 0 Rhyming 1 0 0 0 Adjective 0 1 0 0 Imagery 0 0 1 0 Intentional 0 0 0 1 ## Reassign as sum-to-zero constraint dummy regressors: > contrasts(Process)=contr.sum(levels(Process)) > contrasts(Process) [,1] [,2] [,3] [,4] Counting 1 0 0 0 Rhyming 0 1 0 0 Adjective 0 0 1 0 Imagery 0 0 0 1 Intentional -1 -1 -1 -1 ## Do the same for Age: > contrasts(Age)=contr.sum(levels(Age)) > contrasts(Age) [,1] Older 1 Younger -1 6 Fit the linear model with interaction: > lm.out=lm(Words ~ Process + Age + Process:Age) > Anova(lm.out,type="III") Anova Table (Type III tests) Response: Words Sum Sq Df F value Pr(>F) (Intercept) 13479.2 1 1679.5361 < 2.2e-16 *** Process 1514.9 4 47.1911 < 2.2e-16 *** Age 240.2 1 29.9356 3.981e-07 *** Process:Age 190.3 4 5.9279 0.0002793 *** Residuals 722.3 90 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 The overall F-test had a p-value < 2.2e!16 (not shown). The interaction between Process and Age is significant. We should therefore not look at the test for main e!ects in the Anova output. Instead, we should perform a separate test for Age at each Process level. 7 This means we will be comparing the two ‘cells’ at each Process level. Since we want to do comparisons for one cell vs. another, we will change our perception (and coding) to represent 10 di!erent cells in a one-way ANOVA model. µ1 µ2 µ3 µ4 µ5 µ6 µ7 µ8 µ9 µ10 > levels(Process:Age) [1] "Counting:Older" "Counting:Younger" [3] "Rhyming:Older" "Rhyming:Younger" [5] "Adjective:Older" "Adjective:Younger" [7] "Imagery:Older" "Imagery:Younger" [9] "Intentional:Older" "Intentional:Younger" The above ordering is important for our state- ments. The first group is “Counting:Older”. µCO µCY µRO µRY µAO µAY µImO µImY µInO µInY 8
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved