EZ Statistics

Dunnett's Test

Calculator

2. Select Columns & Options

Learn More

Dunnett's Test

Definition

Dunnett's Test is a multiple comparison procedure used to compare several treatments against a single control group. It maintains the family-wise error rate while providing more statistical power than methods that compare all pairs.

Formula

Test Statistic:

t=XˉiXˉcSEt = \frac{\bar{X}_i - \bar{X}_c}{SE}

Where:

  • Xˉi\bar{X}_i = mean of treatment group i i
  • Xˉc\bar{X}_c = mean of the control group
  • nin_i = sample size of treatment group i i
  • ncn_c = sample size of the control group
  • SESE = standard error of the mean

The standard error of the mean is calculated as:

SE=s×1ni+1ncSE = s \times \sqrt{\frac{1}{n_i} + \frac{1}{n_c}}

Where s2s^2 is the pooled variance, combining the variances of all groups:

s2=i=1k(ni1)si2i=1k(ni1)s^2 = \frac{\sum_{i=1}^k(n_i-1)s_i^2}{\sum_{i=1}^k(n_i-1)}

In ANOVA, the pooled variance corresponds to the within-group variance:

s2=MSWithin=SSWithindfWithins^2 = MS_{\text{Within}} = \frac{SS_{\text{Within}}}{df_{\text{Within}}}

Key Assumptions

Independence: Observations must be independent
Normality: Data within each group should be normally distributed
Homogeneity of Variance: Groups should have equal variances

Practical Example

Step 1: State the Data
GroupDataNMeanSD
Control8.5, 7.8, 8, 8.2, 7.958.080.27
Treatment A9.1, 9.3, 8.9, 9, 9.259.100.16
Treatment B7.2, 7.5, 7, 7.4, 7.357.280.19
Treatment C10.1, 10.3, 10, 10.2, 9.9510.100.16
Step 2: State Hypotheses

For each treatment group i vs control:

  • H0:μi=μcH_0: \mu_i = \mu_c
  • Ha:μiμcH_a: \mu_i \neq \mu_c
  • α=0.05\alpha = 0.05
Step 3: Calculate SS and MSE
  • SSBetween=22.532SS_{Between} = 22.532 with df=19df = 19
  • SSWithin=0.656SS_{Within} = 0.656 with df=16df = 16
  • SSTotal=SSBetween+SSWithin=23.188SS_{Total} = SS_{Between} + SS_{Within} = 23.188
  • MSE=0.65616=0.041MS_{E} = \frac{0.656}{16} = 0.041
Step 4: Calculate Test Statistics

For each treatment vs control:

  • Treatment A: t=9.108.082(0.041)5=7.965t = \frac{9.10 - 8.08}{\sqrt{\frac{2(0.041)}{5}}} = 7.965
  • Treatment B: t=7.288.082(0.041)5=6.247t = \frac{7.28 - 8.08}{\sqrt{\frac{2(0.041)}{5}}} = -6.247
  • Treatment C: t=10.108.082(0.041)5=15.774t = \frac{10.10 - 8.08}{\sqrt{\frac{2(0.041)}{5}}} = 15.774
Step 5: Compare with Critical Value

Critical value for α=0.05\alpha = 0.05, k=3k = 3 treatments, df=16df = 16: tcrit=2.74t_{crit} = 2.74

Compare t|t| with critical value:

  • Treatment A: 7.965>2.74|7.965| > 2.74 (Significant)
  • Treatment B: 6.247>2.74|-6.247| > 2.74 (Significant)
  • Treatment C: 15.774>2.74|15.774| > 2.74 (Significant)
Step 6: Draw Conclusions

All treatments show significant differences from the control group (p<0.05p \lt 0.05):

  • Treatment A significantly increases response
  • Treatment B significantly decreases response
  • Treatment C shows largest significant increase

Code Examples

R
1library(multcomp)
2library(tidyverse)
3# Data preparation
4df = tibble(
5  Group = rep(c("Control", "Treatment A", "Treatment B", "Treatment C"), each = 5),
6  Response = c(8.5, 7.8, 8, 8.2, 7.9, 
7               9.1, 9.3, 8.9, 9, 9.2, 
8               7.2, 7.5, 7, 7.4, 7.3, 
9               10.1, 10.3, 10, 10.2, 9.9)
10)
11
12# multcom package requires the Group variable to be a factor
13df$Group <- as.factor(df$Group)
14
15# Perform one-way ANOVA
16model <- aov(Response ~ Group, data = df)
17
18# Perform Dunnett's test
19dunnett_test <- glht(model, linfct = mcp(Group = "Dunnett"))
20summary(dunnett_test)
Python
1import numpy as np
2from statsmodels.stats.multicomp import pairwise_tukeyhsd
3import pandas as pd
4
5# Create example data
6data = pd.DataFrame({
7    'Response': [8.5, 7.8, 8.0, 8.2, 7.9,  # Control
8                9.1, 9.3, 8.9, 9.0, 9.2,   # Treatment A
9                7.2, 7.5, 7.0, 7.4, 7.3,   # Treatment B
10                10.1, 10.3, 10.0, 10.2, 9.9], # Treatment C
11    'Group': np.repeat(['Control', 'Treatment A', 
12                       'Treatment B', 'Treatment C'], 5)
13})
14
15# Perform multiple pairwise comparisons using Tukey's test
16# (Note: Dunnett's test focuses only on comparisons against a control group, 
17# but statsmodels does not provide a direct implementation of Dunnett's test.)
18results = pairwise_tukeyhsd(data['Response'], 
19                           data['Group'])
20
21print(results)

Alternative Tests

  • Tukey's HSD: When comparing all groups to each other
  • Bonferroni: When a simpler but more conservative approach is needed
  • Games-Howell: When variances are unequal

Related Calculators

One-Way ANOVA Calculator

Tukey's HSD Test Calculator

Two-Way ANOVA Calculator

Effect Size Calculator

Help us improve

Found an error or have a suggestion? Let us know!