skaters <- read.table("http://www.math.montana.edu/~jimrc/classes/stat505/data/olympics1932.txt",skip=20,head=T) skateLong <- data.frame(pair =rep(1:7,each=14), judge=rep(1:7,14), event=rep(c("program","performance"), each=7,7), score=as.numeric(t(as.matrix(skaters[,3:9]) ))) s.country <- c("France","United States","Hungary", "Hungary", "Canada", "Canada", "United States") j.country <- c("Hungary","Norway", "Austria", "Finland", "France", "Great Britain", "United States") skateLong$sameCountry <- with(skateLong, 1*(s.country[skateLong$pair] == j.country[skateLong$judge])) skateLong$pair <- factor(skateLong$pair) skateLong$judge <- factor(skateLong$judge) palette(rainbow(20)[1:10*2]) plot(score~jitter(unclass(pair)),skateLong, pch=sameCountry+1, col=unclass(judge)) summary(lm(score ~ event + sameCountry + pair + judge, skateLong)) require(lme4) summary(lmer(score ~ event + sameCountry + pair + (1|judge), data=skateLong))