One- and two-sample tests

This page introduces tests for comparing a normally distributed set of measurements with a hypothesized value (one-sample) and for comparing the means between two groups (two-sample test).

 
A one-sample t-test is a technique that we can use to test whether a population mean differs from some hypothesised value or standard.
 

One-Sample t-test

If we want to test whether a population mean differs from some standard value, we often cannot use a Z-test because the population standard deviation is often unknown. Instead we need to use a one-sample t-test.

 

P-value Cheat Sheet

It can sometimes get confusing about what part of the distribution we need to consider for certain test statistics and certain tests. For example, when do we want to know the area to the left of the test statistic and when do we want to know the area to the right? The short answer is that it depends on whether our test statistic is positive or negative and what the alternate hypothesis is. It is not always the smaller area! Adding to some of the potential confusion is that R code such as ‘pt( )’ by default provides the area to the left of the test statistic provided.

 

Two-Sample t-Test

A two-sample t-test provides us with a tool to be able to compare the means in two populations when our samples are independent of one another. In the cases where observations in one sample are logically matched with an observation in the other sample then we would use the paired t-test below.

 

Paired t-Test

In a paired design, each observation in one group is logically connected to another observation in the other group. In this case, we use a paired t-test to compare the means between the two groups with paired observations.

Additional Resources


Whitlock & Schluter - The Analysis of Biological Data

Chapter 11: pages 303-317, and Chapter 12: 327-349 [Sapling Ch11, Sapling Ch12]

 

One sample t-test

Intro: An example of a t test on one population mean.

 

Two-sample t-test in R

Advanced: Code tutorial video in R.

Two-sample t-test

Intermediate: Explanation of how to run the student's t-test on a set of data.


Review Questions

 
  1. Which of the following estimates of the t test statistic is most likely to be significant (i.e., occur with a probability of P < 0.05)? Assume that the degrees of freedom are the same for all four estimates of t.

    -0.23 -2.01 1.98 0.5

  2. Can pleasant aromas help a student learn better? Two researchers believed that the presence of a floral scent could improve a person's learning ability in certain situations. They had ten people work through a pencil and paper maze two times, first wearing an unscented mask and then wearing a scented mask. Tests measured the length of time it took subjects to complete each of the two trials. Can they use an independent-samples t-test to analyze their data?

  3. What are the assumptions of the one-sample t-test, paired t-test, and two- sample t-test?

The Next Steps


Confused?

Let’s move down the tree and review these concepts.

Ready to Move Forward?

Let’s move up the tree to the next topic.