Statistical Power – Calculate Effect Size

# enter data, examine it to determine which test is best for
# analysis (Student's t-test, ANOVA, proportions ...), and
# determine whether the effect is small, medium, or large.

# Read in the data:
data.new <- read.table("tmp.head_all", header=TRUE)
# examine data and decide on Student’s t-test
# invoke the library to be used
library(pwr)
cohen.ES(test="t", size="medium")
               Conventional effect size from Cohen (1982)
                                        test = t
                                        size = medium
                                        effect.size = 0.5

Transcript

Well, fortunately, R has a package that we can use to get the effect size, and it's called power "pwr".  So, in this case, we loaded our data and put it into a data frame.  We load the library "pwr".  And, in this case, we're going to call cohen.ES() - which is the conventional effect size described by Cohen in 1982.  We said that we expect a medium-size effect.  Now, the result of the calling this function is the tells that the effect size is 0.5.