Overview and motivation
Figure 1
![mice with different diets](fig/01-example.png)
Mice with different diets
Figure 2
![Graph with mice weight measurements](fig/01-mice-plot.png)
Does the diet affect the mice’s weight?
Our first test: Disease prevalence
Figure 1
![](fig/02-disease-prevalence.png)
Example: Disease prevalence
Figure 2
![binomial probability distribution of number of patients with disease](fig/02-null-distribution.png)
The null distribution
Figure 3
![The null distribution of the number of patients with disease, with significant outcomes indicated by colour.](fig/02-significance.png)
The null distribution
Figure 4
Please take a minute…
One-sided vs. two-sided tests, and data snooping
Figure 1
![Binomial null distribution with one-sided significance indicated.](fig/02-significance.png)
One-sided test
Figure 2
We should look on both sides of the distribution and ask
what outcomes are unlikely. For this, we split the 5% significance to
2.5% on each side. That way, we will reject everything below 1, or above
8. The alternative hypothesis is now that the prevalence is different
from 4%.
Errors in hypothesis testing
Figure 1
![image of confusion matrix](fig/04-errors_hypothesis_testing.png)
Errors in hypothesis testing
One-sample t-test
Figure 1
![graph showing mouse weights of one sample, and a mean to compare them to.](fig/05-mouse-weights.png)
Scenario for one-sided t-test: Comparing mouse
weights to a single value.
Figure 2
![Formula for t-statistic, and graph with moise weights indicating sample mean and mu0](fig/05-t-statistic.png)
The t-statistic is a scaled difference between
sample mean and \(\mu_0\)
Figure 3
![Formula for t-statistic, and image of scale](fig/05-scale.png)
The t-statistic weighs effect size and sample
size against variance.
Figure 4
![Schema for performing a one-sample t-test](fig/05-performing-t-test.png)
One-sample t-test
The distribution of t according to the Central Limit Theorem
Figure 1
![picture of fireworks](fig/celebrate_pngwing.com.png)
The distribution of t in practice
Figure 1
![](fig/07-t-practice-rendered-histogram-t-null-solution-1.png)
Figure 2
![](fig/07-t-practice-rendered-qq-t-null-solution-1.png)
Figure 3
![](fig/07-t-practice-rendered-change-N-1.png)
Figure 4
The t distribution for different degrees of
freedom (wikipedia)
The two-sample and paired t-test
Figure 1
![](fig/08-two-sample-t-test-rendered-unnamed-chunk-2-1.png)
Figure 2
![](fig/08-two-sample-t-test-rendered-unnamed-chunk-3-1.png)
Figure 3
![](fig/08-two-sample-t-test-rendered-unnamed-chunk-5-1.png)
Interpreting p-values
Figure 1
![](fig/09-interpreting-p-values-rendered-irrelevant-diff-1.png)
Figure 2
Have a coffee! (Image: Wikimedia)
Summary and practical aspects
Figure 1
![Image of a cookbook for statistical tests](fig/cookbook.png)
Cookbook (image adapted from kindpng.com)
Figure 2
![Computer screen executing wilcoxon test](fig/in_practice.png)
In practice (image adapted from
kindpng.com)