install.packages(c("lattice","Rcmdr"),contriburl = "http://cran.stat.ucla.edu/bin/windows/contrib/2.6/") library(Rcmdr) library(lattice) #Read in the SPSS file via Rcmdr attach(Marriage) rmmod=aov(DEW~TIME+Error(SUBJECT/TIME), data=Marriage) plot(DEW~TIME, data=Marriage, col="lightblue", cex.axis=.75) interaction.plot(Marriage$TIME, Marriage$SUBJECT, Marriage$DEW, main = "Repeated measures: DEW~Time", col=rainbow(30),fixed=T, cex.axis=.75) #This just gives a quick view of individuals subjects over time summary(rmmod) model.tables(rmmod,"means") rmmod2=aov(DEW~TIME+Error(SUBJECT/TIME), data=Marriage, contrasts = list(TIME = "contr.poly")) summary(rmmod2, split = list(TIME = list(Linear = 1, Quadratic = 2, Cubic=3))) model.tables(rmmod2,"means") source("http://www.unt.edu/rss/class/mike/Rallfun-v9_2.txt") newrmdata=split(Marriage$DEW, Marriage$TIME) rmanova(newrmdata) #default does tr=.20 detach(Marriage) #or rm(Marriage) to permanently remove from the workspace attach(Ice) rmmod3=aov(RATING~(PAIN*TIME)+Error(SUBJECT/(PAIN*TIME)),Ice) interaction.plot(Ice$TIME, Ice$PAIN, Ice$RATING, col=c("red","blue")) summary(rmmod3) model.tables(rmmod3,"means") library(lattice) xyplot(RATING~PAIN:TIME, groups=SUBJECT,xlab="Pain by Time",col=rainbow(8),scales=list(x=list(abbreviate=T, minlength=5, cex=.75, alternating=3)),auto.key= list(space="right") ) barchart(RATING~PAIN:TIME, groups=SUBJECT,xlab="Pain by Time",scales=list(x=list(abbreviate=T, minlength=5, cex=.75, alternating=3)),auto.key= list(space="right") )