Assignment - Sample Size Determination
power.t.test(n= NULL,delta = 0.015, sd= 0.03, power = 0.75, sig.level = 0.05,type = "paired",alternative = "one.sided" )
##
## Paired t test power calculation
##
## n = 22.92961
## delta = 0.015
## sd = 0.03
## sig.level = 0.05
## power = 0.75
## alternative = one.sided
##
## NOTE: n is number of *pairs*, sd is std.dev. of *differences* within pairs
Therefore we can round up n=23 for this part.
Question 2
Can active exercise shorten the time that it takes an infant to learn how to walk alone? Researchers would at a major university would like to design an experiment to test this hypothesis. Specifically, they would like to use one-week old male infants from white middle-class white families as test subjects and allocate into to one of two treatment groups. Those in the active exercise group will receive stimulation of the walking reflexes for four 3-minute sessions each day from the beginning of the second week through the end of the eighth week following birth; those in the other group will receive no such stimulation. Following this, the time (in months) that it takes subjects from each group to walk independently will then be measured. Since this is a preliminary project, the researchers would like to use an alpha=0.10 level of significance for this test, but would like to achieve a power of .85 at detecting a mean difference that is half of the (pooled) standard deviation of walking times. How many infants do they need to enroll in each group? How many total??
First let’s call the library
library(pwr)
pwr.t.test(n= NULL, d=0.5, sig.level = 0.1, power = 0.85, type= "two.sample", alternative= "greater" )
##
## Two-sample t test power calculation
##
## n = 43.40568
## d = 0.5
## sig.level = 0.1
## power = 0.85
## alternative = greater
##
## NOTE: n is number in *each* group
The number of sample size for each group has been calculated = 44 which would add up to 88 in total.
##
## Paired t test power calculation
##
## n = 22.92961
## delta = 0.015
## sd = 0.03
## sig.level = 0.05
## power = 0.75
## alternative = one.sided
##
## NOTE: n is number of *pairs*, sd is std.dev. of *differences* within pairs
##
## Two-sample t test power calculation
##
## n = 43.40568
## d = 0.5
## sig.level = 0.1
## power = 0.85
## alternative = greater
##
## NOTE: n is number in *each* group