“Effect Size” — same data, different interpretations
d<-32; ## Try d<-20 !
## to reduce the death rate by d%, From (50+d/2)% to (50-d/2)%
y<-c(rep("Live",50+d/2),rep("Death",50-d/2));
y<-c(y,rep("Live",50-d/2),rep("Death",50+d/2));
y<-(y=="Live"); ## TRUE vs FALSE
x<-c(rep("Treatment",100),rep("Control",100));
x<-(x=="Treatment");
## correlation^2
cor(x,y,method="pearson")^2
cor(x,y,method="spearman")^2
cor(x,y,method="kendall")^2
## R^2 of linear regression with norminal IV
## should we use logistic regression?
## However, R^2 is not available in GLM.
## summary(lm(y~x))
## names(summary(lm(y~x)))
summary(lm(y~x))$r.squared
## anova
## anova(lm(y~x))
## names(anova(lm(y~x)))
s<-anova(lm(y~x))$"Sum Sq";s[1]/sum(s)
Just a short R-script note to embody the 3-page-paper of [...]
Also tagged effect size, R