27.6 Examples

  • For one-sample t-tests:
    • We suspect the liter of milk we are buying has only 950 ml of milk. We assume a σ=50 ml. Effect size is (1000-950)/50
    • We are sampling from one population to determine if it meets a standard
pwr.t.test(n=NULL, d=1, sig.level=0.05,
           power=0.8, type="one.sample",
           alternative="two.sided")
## 
##      One-sample t test power calculation 
## 
##               n = 9.9
##               d = 1
##       sig.level = 0.05
##           power = 0.8
##     alternative = two.sided
  • For two-sample t-tests
    • We only care if Meijer is shorting us on milk by 50 ml or more, we don’t care if we get more milk. We assume σ=50 ml. Effect size is (950-1000)/50
    • We are sampling from one group
pwr.t.test(n=NULL, d=-1, sig.level=0.05,
power=0.8, type="one.sample", alternative="less")
## 
##      One-sample t test power calculation 
## 
##               n = 7.7
##               d = -1
##       sig.level = 0.05
##           power = 0.8
##     alternative = less

NOTE \(d<0\)