Psyc 480 - Fall 2021

Review of Repeated Measures and Treatment-by-Blocks: Chimps and Sign Language

Many of you probably know from other classes that back in the sixties and seventies, it was all the rage in psychology labs to try to teach sign language to apes. It created quite a controversy, in fact. Apes could learn to use signs from American Sign Language, but were they learning an actual language? I think the jury is still out on that one. The first ape to be taught sign language was a chimp named Washoe, and the last (so far as I know) was a gorilla named Koko. Both are googlable.

These data are from an article by Roger Fouts (Acquisition and testing of gestural signs in four young chimpanzees, Science, 1973, 978-980) in which he describes teaching American Sign Language signs to four chimps, two males and two females. Each chimp was taught the same 10 signs (apparently in the same order), and minutes of training required for each chimp to reach a criterion indicating the sign had been learned was recorded for each sign. The question concerns whether some signs were learned consistently more easily than others. If so, one would have to wonder why. If the signs are just meaningless gestures to the chimps, why would some be so much harder to learn than others? On the other hand, if the signs are associated with their meaning, i.e., if they are words in a gestural language, then one would expect some of them to be harder to learn. That is a characteristic of true language. At the time, it was hotly debated whether chimps being taught sign language were really learning a language, or whether they were just being operantly conditioned to make certain gestures to get a reward. (These data are also used by Ramsey & Schafer, The Statistical Sleuth, p. 398, 1st ed. These are Fouts' real data as published in a table in the Science article.)

The Effect of Signs

You do not need to use R for this lab. However, you are certainly welcome to use R, and I would very strongly advise you to practice using R for this lab. The data are in the table below, which is the data table just as it appeared in Fouts' article. You do not need to fill in the means yet. First, we will get these data into R. I'm personally going to use a script window to do it, but suit yourself.

rm(list=ls())   # clear your workspace
chimps = matrix(c(2, 36, 60, 40, 225, 14, 177, 178, 345, 287,
                 12, 15, 14, 10,  10, 80,  80,  78, 115, 129,
                 10, 25, 18, 25,  15, 55,  20,  99,  54, 476,
                 15, 18, 20, 40,  24,190, 195, 297, 420, 372),
         byrow=T, nrow=4)
rownames(chimps) = c("Bruno", "Booee", "Cindy", "Thelma")
colnames(chimps) = c("listen", "drink", "shoe",	"key", "more", "food", "fruit", "hat", "look", "string")
chimps = as.data.frame(chimps)
chimps

Here is a table of the data. Sign names are the column headers. Chimp names are the row names. The name of the variable in the columns is "signs". The name of the variable in the rows is "chimps". The chimps are the subjects. The numbers represent time in minutes to learn the sign. Complete this table by calculating the marginal means, including the grand mean. As we have the data in an all numeric data frame, you can use apply() to that. (Otherwise, break out your calculator.)

Question: Um, how do I do that?

listendrinkshoekeymorefoodfruithatlookstringMEANS
bruno236604022514177178345287
booee1215141010808078115129
cindy102518251555209954476
thelma1518204024190195297420372
MEANS










Question: What effect is shown in the row marginal means?

Question: What effect is shown in the column marginal means?

Here is a hypothesis: There is no difference in the times it takes chimpanzees to learn various signs in American Sign Language.

Question: Is this a null hypothesis or an alternative (experimental) hypothesis?

Question: Is this a repeated measures design or a treatment by blocks design?

Here is the analysis, which was done by using the rmsaov.test() function. Aside: you might be wondering why we converted the matrix to a data frame only to convert it back to a matrix when we run this function. The reason is in many ways it is more convenient to work with a data frame than with a matrix. I'll try to point that out below, if I remember.

source("http://ww2.coastal.edu/kingw/psyc480/functions/rmsaov.R")
rmsaov.test(as.matrix(chimps))

	Oneway ANOVA with repeated measures

data:  as.matrix(chimps)
F = 5.9473, df treat = 9, df error = 27, p-value = 0.0001407

MS.error MS.treat MS.subjs 
 7002.94 41648.90 23669.29 

Treatment Means
listen  drink   shoe    key   more   food  fruit    hat   look string 
  9.75  23.50  28.00  28.75  68.50  84.75 118.00 163.00 233.50 316.00 

HSD.Tukey.95 
    203.5372 

Compound Symmetry Check (Variance-Covariance Matrix)
           listen      drink      shoe     key       more       food       fruit         hat       look     string
listen   30.91667  -48.16667 -108.0000  -23.75  -530.5000   360.9167   -54.33333   126.66667   -65.5000    46.0000
drink   -48.16667   87.00000  182.6667   77.50   872.6667  -489.1667   163.33333    25.66667   368.6667   386.3333
shoe   -108.00000  182.66667  461.3333  190.00  2239.3333  -914.0000   928.00000   412.66667  1843.3333  -119.3333
key     -23.75000   77.50000  190.0000  206.25   852.5000   196.2500   870.00000  1170.00000  2082.5000  1070.0000
more   -530.50000  872.66667 2239.3333  852.50 10919.0000 -4628.8333  4424.33333  1593.66667  8562.0000 -1550.3333
food    360.91667 -489.16667 -914.0000  196.25 -4628.8333  5663.5833  2342.00000  5116.66667  5881.1667  1358.0000
fruit   -54.33333  163.33333  928.0000  870.00  4424.3333  2342.0000  6819.33333  6901.66667 14344.3333 -1991.0000
hat     126.66667   25.66667  412.6667 1170.00  1593.6667  5116.6667  6901.66667  9834.00000 16074.6667  4241.3333
look    -65.50000  368.66667 1843.3333 2082.50  8562.0000  5881.1667 14344.33333 16074.66667 31159.0000   216.6667
string   46.00000  386.33333 -119.3333 1070.00 -1550.3333  1358.0000 -1991.00000  4241.33333   216.6667 21515.3333

Estimated Greenhouse-Geisser Epsilon and Adjusted p-value
   epsilon   p-adjust 
0.28804515 0.02269214

Use the information in this output to fill in the following ANOVA summary table.

dfSSMSFp-adjust
chimps
signs
error
total

Explanation: Last time I'm going to explain this, SS=MS*df. SS.total can be calculated two ways. One is to add down the column of SSes, which would give the answer given above in the box. The other way is to use the SS() function to get the sum of squares of the DV, in which case the answer is 634927.38.

Question: What is the correct decision regarding the null hypothesis (alpha=0.05)?

Question: This is a decision about the main effect of what variable?

Question: What is the value of eta-squared for this effect?

Explanation: The effect size can be calculated in two different ways here. The first is SS.signs/SS.total, which gives the answer in the box. The other is to calculate SS.signs/(SS.signs+SS.error), which is called partial eta-squared and is equal to 0.66. Since the question asks specifically for eta-squared, 0.59 is the only right answer here.

Question: What does that indicate about the effect size?

Here is a graph. (Signs shown as 1-10. 1=listen, 2=drink, etc.)

chimps graph

Question: What effect is shown most prominently on this graph?

Question: If there were a signs x chimps interaction, would that be a good thing or a bad thing for the repeated measures ANOVA?

Question: Would you say the homogeneity of variance assumption has been violated in this analysis? (Hint: look at the main diagonal of the variance-covariance natrix.)

Question: Would you say the sphericity assumption has been violated in this analysis? (Hint: look at the values off the main diagonal of the variance-covariance matrix.)

Question: Given that this is a balanced design, if these assumptions were to be violated, would that really be such a serious problem?

Question: Somewhere above there is a statistic that assesses how severely the sphericity assumption has (or has not) been violated. What is the value of that statistic?

Explanation: The statistic is Greenhouse-Geisser epsilon. Notice this is one of the worst cases we've seen. GGE is much closer to it's minimum possible value than it is to its maximum. Look what it's done to the p-value. We almost lost the significant effect here!

Question: What is the maximum possible (best possible) value of that statistic?

Question: What is the minimum possible (worst possible) value of that statistic in this case?

Question: If we were to do post hoc comparisons between the levels of signs, and we did every possible pairwise comparison, how may comparisons would that be? Hint: write them all out if you have to. There's a lot of them!

Here is one of those comparisons. Apply a Bonferroni adjustment to the p-value.

> t.test(chimps$listen, chimps$string, paired=T)

	Paired t-test

data:  chimps$listen and chimps$string
t = -4.1817, df = 3, p-value = 0.02492
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -539.32074  -73.17926
sample estimates:
mean of the differences 
                -306.25

Question: p-adjust =

Explanation: It is 45*0.02492. However, that comes out to be greater than 1, and a probability can't be greater than 1, so the rule is, if the Bonferroni correction gives a value greater than 1, call it 1. By the way, this is where it would have been tricky if we'd had a matrix instead of a data frame, because you cannot pick a column out of a matrix with $.

Question: If you were to apply a Tukey HSD test to the signs effect, how large would the difference have to be before you could call it a significant difference?

Question: Think about what is shown in the graph above. In this graph, the signs are arranged along the horizontal axis from easiest to hardest (according to mean learning time). Given this, are you surprised by what you see in this graph? Yes or no, and why or why not?

Answer: No, you certainly shouldn't be surprised. This is basic learning principles 101. Everybody does well on the easy stuff. It's the harder items that separate the smarter subjects from the others.

The Effect of Chimps

Suppose you wanted to test for the chimps effect. You can't do this with the rmsaov.test() function with the data in its current form, because that function tests only the column effect, and chimps are in the rows. Fortunately, there is an R function that comes to our rescue. What we're going to do is grab the data frame by its upper left and lower right corners and flip it up on its side. That's called a transpose, and the R function that does it is t().

> t(chimps)
       Bruno Booee Cindy Thelma
listen     2    12    10     15
drink     36    15    25     18
shoe      60    14    18     20
key       40    10    25     40
more     225    10    15     24
food      14    80    55    190
fruit    177    80    20    195
hat      178    78    99    297
look     345   115    54    420
string   287   129   476    372

Pretty to look at, but not useful. Why? Because we didn't store it into the workspace.

chimps2 = t(chimps)

There we go!

Question: Is this a repeated measures design or a treatment by blocks design?

Now do the analysis with rmsaov.test() and answer the following questions.

Question: Is the chimps effect statistically significant? What is the uncorrected p-value?

Question: What is the adjusted p-value?

Complete the following table of Tukey HSD tests.

diff lwr upr significance
Bruno-Booee
Cindy-Booee
Thelma-Booee
Cindy-Bruno
Thelma-Bruno
Thelma-Cindy

There is a data set at the website (how many of you thought to check?) called chimpslong.csv. Fetch it this way.

chimpslong=read.csv("http://ww2.coastal.edu/kingw/psyc480/data/chimpslong.csv")
summary(chimpslong)
     times           chimps       signs   
 Min.   :  2.00   booee :10   drink  : 4  
 1st Qu.: 17.25   bruno :10   food   : 4  
 Median : 47.00   cindy :10   fruit  : 4  
 Mean   :107.38   thelma:10   hat    : 4  
 3rd Qu.:177.25               key    : 4  
 Max.   :476.00               listen : 4  
                              (Other):16

Analyze by using the treatment-by-subjects method and then compare your results to the ones we got above.

Note: I'm not sure, but you may also have to do the following to get this to work.

chimpslong$chimps = factor(chimpslong$chimps)
chimpslong$signs = factor(chimpslong$signs)

Erase ALL your answers and start again: