Skip to content
Snippets Groups Projects
Commit ace9ee88 authored by Boulakis Paradeisios Alexandros's avatar Boulakis Paradeisios Alexandros
Browse files

ex01

parent dcfd5ca2
No related branches found
No related tags found
No related merge requests found
list.of.packages <- c("pwrss")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
library(pwrss)
########################################################
# parameters for independent t-test
control.group.mean <- 130
control.group.sd <- 15
drug.group.mean <- 120
drug.group.sd <- 15
alpha.level <- .05
required.power <- .95
alternative <- "not equal" # also try "greater", "less"
########################################################
# find the correct function
# assign the correct parameters
# you can look around the documentation of pwrss library using ??pwrss
t.test.power <-
plot(t.test.power)
#######################################################
# parameters for paired-sample t-test
drug.before.mean <- 130
drug.before.sd <- 15
drug.after.mean <- 120
drug.after.sd <- 15
alpha.level <- .05
required.power <- .95
alternative <- "not equal" # also try "greater", "less"
########################################################
# find the correct function
# assign the correct parameters
# you can look around the documentation of pwrss library using ??pwrss
paired.t.power <-
plot(paired.t.power)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment