Data for Example 7.22

Bones

Format

A data frame/tibble with 70 observations on two variables

density

bone density measurements

group

a factor with levels active and nonactive

References

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.

Examples


t.test(density ~ group, data = Bones, alternative = "greater")
#> 
#> 	Welch Two Sample t-test
#> 
#> data:  density by group
#> t = 0.83732, df = 66.806, p-value = 0.2027
#> alternative hypothesis: true difference in means is greater than 0
#> 95 percent confidence interval:
#>  -3.99656      Inf
#> sample estimates:
#>    mean in group active mean in group nonactice 
#>                211.6286                207.6000 
#> 
t.test(rank(density) ~ group, data = Bones, alternative = "greater")
#> 
#> 	Welch Two Sample t-test
#> 
#> data:  rank(density) by group
#> t = 2.1844, df = 67.867, p-value = 0.0162
#> alternative hypothesis: true difference in means is greater than 0
#> 95 percent confidence interval:
#>  2.446855      Inf
#> sample estimates:
#>    mean in group active mean in group nonactice 
#>                40.67143                30.32857 
#> 
wilcox.test(density ~ group, data = Bones, alternative = "greater")
#> Warning: cannot compute exact p-value with ties
#> 
#> 	Wilcoxon rank sum test with continuity correction
#> 
#> data:  density by group
#> W = 793.5, p-value = 0.01695
#> alternative hypothesis: true location shift is greater than 0
#>