> #Alcoholic Intake Data > al <- read.table("http://www.rohan.sdsu.edu/~babailey/stat672/t4-2.txt", header=T) > library(exactRankTests) Package 'exactRankTests' is no longer under development. Please consider using package 'coin' instead. > al control sst 1 1042 874 2 1617 389 3 1180 612 4 973 798 5 1552 1152 6 1251 893 7 1151 541 8 1511 741 9 728 1064 10 1079 862 11 951 213 12 1319 NA > attach(al) > #Example 4.2 > wilcox.exact(sst, control, alternative="less") Exact Wilcoxon rank sum test data: sst and control W = 15, p-value = 0.0004904 alternative hypothesis: true mu is less than 0 > #Problem 5.9 > ansari.exact(sst, control) Ansari-Bradley test data: sst and control AB = 67, p-value = 0.8567 alternative hypothesis: true ratio of scales is not equal to 1 > #p. 156, Comment 13. Unequal and Unknown Medians: modification > controlp <- control-median(control) > sstp <- sst - median(sst, na.rm=T) > ansari.exact(sstp, controlp) Ansari-Bradley test data: sstp and controlp AB = 71, p-value = 0.81 alternative hypothesis: true ratio of scales is not equal to 1