Can someone help me understand how to calculate cohen's D from an ANOVA with contrasts? I have no problem calculating cohen's D from vectors or datasets, but can't figure out how to do it from a contrast. Thanks.
#Create data frame
group = c("treatment","treatment","treatment","treatment","treatment","treatment","treatment","treatment","treatment","treatment",
"control","control","control","control","control","control","control","control","control","control",
"other","other","other","other","other","other","other","other","other","other")
score = c(7,8,9,10,7,8,9,10,7,8,
6,5,4,6,5,4,6,5,4,6,
3,2,1,3,2,1,3,2,1,3)
sample =data.frame(group,score)
#Set contrasts
contrast = c(-1,0,1)
#Bind contrasts
contrasts(sample$group) = cbind(contrast)
#Check contrasts
contrasts(sample$group)
#Run ANOVA w/ contrasts
aov1 = aov(score ~ group, sample)
summary.lm(aov1)