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

#File.Location <- file.path(zz,"BALANCED.sav")
File.Location <- file.path(zz,"BALANCED.csv")
library(foreign)
y <- read.csv(File.Location)
y <- data.frame(y)
attach(y)
regout <- lm(score ~ task*group,data=y)
regout <- lm(score ~ as.factor(task)*as.factor(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")
emcatcat