zz <- file.path("U:","My Documents")

File.Location <- file.path(zz,"BALANCED.sav")
library(foreign)
y <- read.spss(File.Location)
y <- data.frame(y)
attach(y)
regout <- lm(score ~ task*group,data=y)
anova(regout)

# group means

install.packages("plyr")
library(plyr)
ddply(y,.(group),summarise,mean=mean(score),sd=sd(score))

# unpacking interactions as simple effects

install.packages("emmeans")
library(emmeans)
emcatcat <- emmeans(regout, ~ task*group, data=y)
contrast(emcatcat, "revpairwise",by="group",adjust="none")
