implant=c(231,308287,33291,124550,17075,22955,95102,5649,840585,58924) control=c(35324,12457,8276,44,278,840) interleukin.6=c(implant,control) group=c(rep("implant",length(implant)),rep("control",length(control))) boxplot(interleukin.6~group) library(lattice) dotplot(interleukin.6~group) # looks highly skewed to the right; normality not a good assumption # also samples sizes too small to use t-test anyway (CLT) # one solution is to try to *transform* the data so they # are approximately normal. # common transformations: log(x), sqrt(x), 1/x # is log-transformed data approximately normal? boxplot(log(interleukin.6)~group) dotplot(log(interleukin.6)~group) # is log-transformed data approximately normal? shapiro.test(log(interleukin.6[group=="implant"])) shapiro.test(log(interleukin.6[group=="control"])) # looks good! a t-test on the log-transformed values is OK! t.test(log(interleukin.6)~group) # how about a permutation test? Like MWW, it's *always* valid library(DAAG) twot.permutation(interleukin.6[group=="implant"],interleukin.6[group=="control"]) twot.permutation(log(interleukin.6[group=="implant"]),log(interleukin.6[group=="control"])) # note that transforming data can make comparing means easier! # What happens if we transform data and use MWW? wilcox.test(interleukin.6[group=="implant"],interleukin.6[group=="control"]) wilcox.test(log(interleukin.6[group=="implant"]),log(interleukin.6[group=="control"])) # Why does this happen???