Low et al (2016) examined the effects of two different anesthetics on aspects of the physiology of the mouse. Twelve mice were anesthetized with isoflurane and eleven mice were anesthetized with alpha chloralose and blood CO2 levels were recorded after 120 minutes. The H0 was that there is no difference between the anesthetics in the mean blood CO2 level. This is an independent comparison because individual mice were only given one of the two anesthetics.

Preliminaries

First, load the required packages (tidyverse, RMisc, MKinfer, car, emmeans)

Import low data file

low <- read.csv("../data/lowco2.csv")
low

Get summary statistics by anesthetic

low_stats <- summarySE(data=low,measurevar="co2", groupvars="anesth")
low_stats
low %>%  
  group_by (anesth) %>% 
summarise (median = median(co2), mean=mean(co2))

Fit model and get effect size

low.aov <- aov(co2~anesth,data=low)
tidy(low.aov, conf.int=TRUE)

low.emm <- emmeans(low.aov,"anesth")
eff_size(low.emm, sigma=sigma(low.aov), edf=df.residual(low.aov))
 contrast effect.size    SE df lower.CL upper.CL
 ac - iso        1.29 0.463 21    0.329     2.25

sigma used for effect sizes: 16.2 
Confidence level used: 0.95 

Note that we’ve chosen to show a standardized effect size, using the pooled variance from the analysis of variance - Residual MS = 262.44, and √262.44 = 16.2

Test variances

leveneTest(co2 ~ anesth, low)
Warning: group coerced to factor.
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  1   2.604 0.1215
      21               

t-test for equal variances

t.test(co2~anesth,var.equal=TRUE, data=low)

    Two Sample t-test

data:  co2 by anesth
t = 3.0927, df = 21, p-value = 0.005515
alternative hypothesis: true difference in means between group ac and group iso is not equal to 0
95 percent confidence interval:
  6.849172 34.969010
sample estimates:
 mean in group ac mean in group iso 
         70.90909          50.00000 

t-test for separate variances

t.test(co2~anesth,data=low)

    Welch Two Sample t-test

data:  co2 by anesth
t = 3.0206, df = 15.485, p-value = 0.008362
alternative hypothesis: true difference in means between group ac and group iso is not equal to 0
95 percent confidence interval:
  6.194866 35.623316
sample estimates:
 mean in group ac mean in group iso 
         70.90909          50.00000 

Wilcoxon-Mann-Whitney

wilcox.test(co2~anesth,data=low)
Warning: cannot compute exact p-value with ties

    Wilcoxon rank sum test with continuity correction

data:  co2 by anesth
W = 114, p-value = 0.003398
alternative hypothesis: true location shift is not equal to 0
sum(rank(low$co2)[low$anesth=="ac"])
[1] 180
sum(rank(low$co2)[low$anesth=="iso"])
[1] 96
LS0tCnRpdGxlOiAiUUsgQm94IDIuMiIKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6CiAgICB0aGVtZTogZmxhdGx5Ci0tLQoKYGBge3Igc2V0dXAsIGluY2x1ZGU9RkFMU0V9CmtuaXRyOjpvcHRzX2NodW5rJHNldChlY2hvID0gVFJVRSkKYGBgCgpMb3cgZXQgYWwgKDIwMTYpIGV4YW1pbmVkIHRoZSBlZmZlY3RzIG9mIHR3byBkaWZmZXJlbnQgYW5lc3RoZXRpY3Mgb24gYXNwZWN0cyBvZiB0aGUgcGh5c2lvbG9neSBvZiB0aGUgbW91c2UuIFR3ZWx2ZSBtaWNlIHdlcmUgYW5lc3RoZXRpemVkIHdpdGggaXNvZmx1cmFuZSBhbmQgZWxldmVuIG1pY2Ugd2VyZSBhbmVzdGhldGl6ZWQgd2l0aCBhbHBoYSBjaGxvcmFsb3NlIGFuZCBibG9vZCBDT34yfiBsZXZlbHMgd2VyZSByZWNvcmRlZCBhZnRlciAxMjAgbWludXRlcy4gVGhlICpIKn4wfiB3YXMgdGhhdCB0aGVyZSBpcyBubyBkaWZmZXJlbmNlIGJldHdlZW4gdGhlIGFuZXN0aGV0aWNzIGluIHRoZSBtZWFuIGJsb29kIENPfjJ+IGxldmVsLiBUaGlzIGlzIGFuIGluZGVwZW5kZW50IGNvbXBhcmlzb24gYmVjYXVzZSBpbmRpdmlkdWFsIG1pY2Ugd2VyZSBvbmx5IGdpdmVuIG9uZSBvZiB0aGUgdHdvIGFuZXN0aGV0aWNzLgoKIyMgUHJlbGltaW5hcmllcwoKRmlyc3QsIGxvYWQgdGhlIHJlcXVpcmVkIHBhY2thZ2VzICh0aWR5dmVyc2UsIFJNaXNjLCBNS2luZmVyLCBjY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