STA4173: Biostatistics
Spring 2025
We have now learned one- and two-sample t-tests.
Recall, when we have two samples, they can be independent samples or dependent samples.
Independent samples: two-sample t-test
Dependent samples: paired t-test (one-sample t-test on difference)
Today we will discuss how to assess the assumptions on t-tests.
All t-tests assume approximate normality of the data.
In the case of one-sample t-tests, the measure of interest must somewhat follow a normal distribution.
In the case of two-sample t-tests, the measure of interest in each group must somewhat follow a normal distribution.
Note that a paired t-test is technically a one-sample t-test, so we will examine normality of the difference.
There are formal tests for normality (see article here), however, we will not use them.
Instead, we will assess normality using a quantile-quantile (q-q) plot.
This is a scatterplot that will form a 45° line if the assumed distribution is correct.
We will create q-q plots for:
The measurements in the case of the one-sample t-test.
The measurements from each group in the case of the two-sample t-test.
The difference between the groups in the case of the paired t-test.
We will assess the normality assumption graphically using a q-q plot
A package was written by a former student, classpackage
.
If you are working on the server, the package is already installed.
If you are not working on the server, please ask me for the code needed to install.
independent_qq_plot()
function.Recall the penguin example for the two-sample t-test.
classpackage
package, we are now interested in the dependent_qq_plot()
function.Important note!!
Next up: