11 Two sample tests

Two sample tests are for cases in which you want to compare two independent samples. Like:

Are the students in school A yielding better math scores than students in School B?.

Are apples heavier than oranges?.

The premise is that the more similar the two samples, the less likely they are to be significantly different.

Two populations with different means, n=5

Figure 11.1: Two populations with different means, n=5

These types of questions can be answered with either the Z-test or the T-Test, which we will introduce in this chapter. Both of these tests are suited for two-sample tests, but the Z-test is preferred to the t-test for large samples (n > 30) or when the population variance is known.

Z-test or T-test?

Figure 11.2: Z-test or T-test?

At the end of this chapter, you are expected to:

  1. Run a two sample Z-test and interpret its results from R.

  2. Run a two sample T-test and interprets its results from R.