Course contentsShow
← Data Science
Lesson 1393 of 2,14535. Statistical Anomaly DetectionFree lesson

Two-Sided vs One-Sided Grubbs' Test

Distinguishing between testing for extreme values in both tails versus only the maximum or minimum.

Two-Sided vs One-Sided Grubbs' Test

You'll learn when to test for outliers in both directions versus focusing on just the maximum or minimum value.

The Core Distinction

Grubbs' Test can be applied in three different ways depending on what kind of anomaly you're hunting for:

Two-sided (two-tailed) test: This tests whether the most extreme value — either the maximum OR minimum — is an outlier. You don't know in advance which tail matters; you're just checking if the value furthest from the mean (in either direction) is suspicious. This is the default approach when you care about unusual values regardless of direction.

One-sided (one-tailed) tests: These focus on a specific direction:

  • Maximum test: Only checks if the largest value is an outlier
  • Minimum test: Only checks if the smallest value is an outlier

When to Use Each

Think of quality control scenarios:

  • Two-sided: You're monitoring patient blood pressure readings and want to flag any extreme value, high or low, because both indicate problems.

  • One-sided (maximum): You're testing product dimensions where oversized items break downstream machinery, but undersized items are fine.

  • One-sided (minimum): You're checking server response times where slow responses matter, but faster-than-expected times are welcomed.

The test statistic calculation adjusts slightly, and you'll compare against different critical values depending on which variant you choose. The one-sided tests are more powerful (better at detecting outliers) when you know the direction in advance, but they'll miss anomalies in the opposite tail.

Key Takeaway: Choose two-sided Grubbs' Test when anomalies could occur in either direction; use one-sided tests when you specifically care about only maximum or minimum values, gaining statistical power by focusing your hypothesis.