data <- matrix(scan(),ncol=3,byrow=TRUE) 1 1 5 1 2 5 2 1 1 2 2 7 3 1 4 3 2 12 4 1 11 4 2 9 5 1 13 5 2 13 data Lotion1 <- data.frame(data) colnames(Lotion1) <- c("subject","lotion","allergy") levels(Lotion1$subject) <- c("jim","sally","bob","julie","karl") # names for the 5 subjects (blocks) Lotion1$lotion <- as.factor(Lotion1$lotion) # to make sure that lotion is a factor, not numeric Lotion1$subject <- as.factor(Lotion1$subject) # to make sure that subject is a factor, not numeric rm(data) Lotion1 summary(lm(allergy ~ subject + lotion, data = Lotion1)) anova(lm(allergy ~ subject + lotion, data = Lotion1)) par(mfrow=c(2,2)) plot(lm(allergy ~ subject + lotion, data = Lotion1)) par(mfrow=c(1,1)) rm(Lotion1)