data <- matrix(scan(),ncol=3,byrow=TRUE) 1 1 26.1 1 2 22.7 1 3 22.5 1 4 22.6 2 1 81.0 2 2 53.2 2 3 53.7 2 4 53.1 3 1 10.5 3 2 9.7 3 3 10.8 3 4 8.3 4 1 26.6 4 2 19.6 4 3 21.1 4 4 21.6 5 1 12.9 5 2 13.8 5 3 13.7 5 4 13.3 6 1 57.2 6 2 47.1 6 3 39.2 6 4 37.0 7 1 25.0 7 2 13.6 7 3 13.7 7 4 14.8 8 1 20.3 8 2 23.6 8 3 16.3 8 4 14.8 data Potential1 <- data.frame(data) colnames(Potential1) <- c("subject","emotion","SkinPotential") levels(Potential1$emotion) <- c("Fear","Happiness","Depression","Calmness") Potential1$subject <- as.factor(Potential1$subject) # to make sure that subject is a factor, not numeric Potential1$emotion <- as.factor(Potential1$emotion) # to make sure that emotion is a factor, not numeric rm(data) Potential1 summary(lm(SkinPotential ~ subject + emotion, data = Potential1)) anova(lm(SkinPotential ~ subject + emotion, data = Potential1)) par(mfrow=c(2,2)) plot(lm(SkinPotential ~ subject + emotion, data = Potential1)) par(mfrow=c(1,1)) friedman.test(SkinPotential ~ emotion | subject, data = Potential1) # Friedman rank test, syntax is y ~ treatment | blocks