######################################################
# pretest-posttest design with treatment group only #
######################################################
# a researcher is expecting a difference of Cohen's d = 0.30
# between posttest and pretest score translating into
# Eta-squared = 0.022
pwrss.f.rmanova(eta2 = 0.022, n.levels = 1, n.rm = 2,
corr.rm = 0.50, type = "within",
alpha = 0.05, power = 0.80)
# paired t-test approach
pwrss.t.2means(mu1 = 0.30, mu2 = 0,
sd1 = 1, sd2 = 1,
paired = TRUE, paired.r = 0.50,
alpha = 0.05, power = 0.80)
##########################################################
# posttest only design with treatment and control groups #
##########################################################
# a researcher is expecting a difference of Cohen's d = 0.50
# on the posttest score between treatment and control groups
# translating into Eta-squared = 0.059
pwrss.f.rmanova(eta2 = 0.059, n.levels = 2, n.rm = 1,
type = "between",
alpha = 0.05, power = 0.80)
# independent t-test approach
pwrss.t.2means(mu1 = 0.50, mu2 = 0,
sd1 = 1, sd2 = 1,
alpha = 0.05, power = 0.80)
#############################################################
# pretest-posttest design with treatment and control groups #
#############################################################
# a researcher is expecting a difference of Cohen's d = 0.40
# on the posttest score between treatment and control groups
# after controlling for the pretest translating into
# partial Eta-squared = 0.038
pwrss.f.rmanova(eta2 = 0.038, n.levels = 2, n.rm = 2,
corr.rm = 0.50, type = "between",
alpha = 0.05, power = 0.80)
# regression approach
p <- 0.50 # proportion of subjects in treatment group
pwrss.t.reg(beta1 = 0.40, r2 = 0.25, k = 2,
sdx = sqrt(p*(1-p)),
alpha = 0.05, power = 0.80)
# a researcher is expecting an interaction effect
# (between groups and time) of Eta-squared = 0.01
pwrss.f.rmanova(eta2 = 0.01, n.levels = 2, n.rm = 2,
corr.rm = 0.50, type = "interaction",
alpha = 0.05, power = 0.80)
Run the code above in your browser using DataLab