Processing math: 100%

Two-Tailed Tests

Matthew J. Crossley

2025

Introduction to two-tailed tests

  • We have seen that one-tailed tests are used to determine if the mean of a sample is significantly greater than or less than a hypothesized value.

  • Two-tailed tests are used to determine if the mean of a sample is significantly different from a hypothesized value.

Imagine two universes

  • Null Universe: The neuron is not stimulus-driven. The Expected Value of X is 10 spikes per second.

  • Alternative Universe: The neuron is stimulus-driven but the drive can be excitatory or inhibitory.

  • We want to know which universe we are in.

  • We write this as:

H0:μX=10H1:μX10

The null universe

Two-tailed p-value

Two-tailed recipe

  • Everything proceeds the same as for a one-tailed test until you get to the p-value calculation.

  • At that stage, you must mirror the observed test statistic value (e.g., the observed sample mean) across the center of the null distribution and compute the area under the curve in both tails.

  1. Specify the null and alternative hypotheses (H0 and H1) in terms of a population parameter θ.

  2. Specify the type I error rate – denoted by the symbol α – you are willing to tolerate.

  3. Specify the sample statistic ˆθ that you will use to estimate the population parameter θ in step 1 and state how it is distributed under the assumption that H0 is true.

  4. Obtain a random sample and use it to compute the sample statistic from step 3. Call this value ˆθobs.

  5. If ˆθobs or a more extreme outcome in either tail is very unlikely to occur under the assumption that H0 is true, then reject H0. Otherwise, do not reject H0.

Two-tailed example

  • Suppose a neuron has a baseline firing rate of 10 spikes/sec. After presenting a stimulus, we record a sample of 25 trials, and observe:

    ˉXobs=9.85 spikes/sec

  • We want to test:

    H0:μX=10H1:μX10

  • Under H0, ˉXN(10,1225)=N(10,0.04)

  • The two-tailed p-value by calculating the area under both tails beyond the mirrored observed value:

    p=P(ˉX9.85)+P(ˉX10.15)

  • This tells us how likely we are to see a value this far (or farther) from 10 — in either direction — if the null is true.

  • In this case, p=0.4597, which you would compute using pnorm() in R if you needed to.