library(RColorBrewer) library(colorspace) library(sciplot) library(psych) library(car) #subj,cond,trial,group,EntryTimes rt = read.table("EntryTimes.csv",sep=",",header=TRUE) rt$subj <- factor(rt$subj) rt$cond <- factor(rt$cond) rt$trial <- factor(rt$trial) rt$group <- factor(rt$group) attach(rt) # mean mean(EntryTimes) # standard error sd(EntryTimes)/sqrt(length(EntryTimes)) print(model.tables(aov(EntryTimes ~ cond,rt),"means"),digits=3) summary(aov(EntryTimes ~ cond,rt)) # repeated-measures (aka within-subjects) one-way ANOVA summary(aov(EntryTimes ~ cond + Error(subj / cond),rt)) pairwise.t.test(EntryTimes, cond, p.adjust="bonf") # repeated-measures two-way ANOVA summary(aov(EntryTimes ~ (cond * trial * group) + Error(subj / (cond * trial)),rt)) pdf.options(family="NimbusSan",useDingbats=FALSE) pdf("./speed.pdf") bargraph.CI(cond, EntryTimes, group=NULL, data=rt, split = FALSE, col = "black", angle = c(45,45), density = c( 0,20), lc = FALSE, uc = TRUE, legend = FALSE, # ylim = c(0,40), xlab = "Keyboard", ylab = "Entry Speed (s; with SE)", cex.lab = 1.2, names.arg = c("Opti","QWERTY"), cex.names = 1.1, main = "Entry Speed vs. Keyboard" ) dev.off() embedFonts("./speed.pdf", "pdfwrite", outfile = "./speed.pdf", fontpaths = c("/sw/share/texmf-dist/fonts/type1/urw/helvetic", "/usr/share/texmf/fonts/type1/urw/helvetic", "/usr/local/teTeX/share/texmf-dist/fonts/type1/urw/helvetic", "/usr/share/texmf-texlive/fonts/type1/urw/helvetic", "/usr/local/texlive/texmf-local/fonts/type1/urw/helvetic")) detach(rt)