6.13 Solutions

Solution to Exercise 6.12.1:

Solution to Exercise 6.12.2:

## 
##  Welch Two Sample t-test
## 
## data:  lifeExp by year
## t = -4.7007, df = 63.869, p-value = 1.428e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -15.681981  -6.327769
## sample estimates:
## mean in group 1952 mean in group 1972 
##           46.31439           57.31927

Solution to Exercise 6.12.3:

## # A tibble: 5 x 9
## # Groups:   continent [5]
##   continent estimate statistic  p.value parameter conf.low conf.high method
##   <fct>        <dbl>     <dbl>    <dbl>     <dbl>    <dbl>     <dbl> <chr> 
## 1 Africa        54.8   -11.4   1.33e-15        51     52.1      57.5 One S…
## 2 Americas      73.6     4.06  4.50e- 4        24     71.8      75.4 One S…
## 3 Asia          70.7     0.525 6.03e- 1        32     67.9      73.6 One S…
## 4 Europe        77.6    14.1   1.76e-14        29     76.5      78.8 One S…
## 5 Oceania       80.7    20.8   3.06e- 2         1     74.2      87.3 One S…
## # … with 1 more variable: alternative <chr>

Solution to Exercise 6.12.4:

## # A tibble: 5 x 5
## # Groups:   continent [5]
##   continent statistic p.value parameter method                      
##   <fct>         <dbl>   <dbl>     <int> <chr>                       
## 1 Africa        2.10    0.553         3 Kruskal-Wallis rank sum test
## 2 Americas      0.847   0.838         3 Kruskal-Wallis rank sum test
## 3 Asia          1.57    0.665         3 Kruskal-Wallis rank sum test
## 4 Europe        0.207   0.977         3 Kruskal-Wallis rank sum test
## 5 Oceania       1.67    0.644         3 Kruskal-Wallis rank sum test