27.5 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
    • If we suspect the liter sold at Meijer has 50 more ml than the liter sold at Kroger, we assume σ=50 ml. Effect size is (1050-1000)/50
    • We are sampling from two groups to determine if they are different
pwr.t.test(n=NULL, d=1, sig.level=0.05,
           power=0.8, type="two.sample",
           alternative="two.sided")
## 
##      Two-sample t test power calculation 
## 
##               n = 17
##               d = 1
##       sig.level = 0.05
##           power = 0.8
##     alternative = two.sided
## 
## NOTE: n is number in *each* group