GAMESHOWELL
Games-Howell is a post-hoc pairwise comparison procedure that does not assume equal variances or equal sample sizes.
It is commonly used after Welch ANOVA to compare all group means with variance-sensitive standard errors and adjusted p-values. The output includes pair labels, test statistics, p-values, and effect-size summaries.
This wrapper accepts tabular data and returns Pingouin’s Games-Howell comparison table.
Excel Usage
=GAMESHOWELL(data, dv, between, effsize)
data(list[list], required): Input table where the first row contains column names.dv(str, required): Name of the dependent-variable column.between(str, required): Name of the grouping column.effsize(str, optional, default: “hedges”): Effect size metric for pairwise contrasts.
Returns (list[list]): 2D table containing Games-Howell pairwise comparison results.
Example 1: Games-Howell on three groups
Inputs:
| data | dv | between | |
|---|---|---|---|
| score | grp | score | grp |
| 4.8 | A | ||
| 5.1 | A | ||
| 5 | A | ||
| 6.2 | B | ||
| 6.5 | B | ||
| 6.7 | B | ||
| 8 | C | ||
| 8.5 | C | ||
| 8.3 | C |
Excel formula:
=GAMESHOWELL({"score","grp";4.8,"A";5.1,"A";5,"A";6.2,"B";6.5,"B";6.7,"B";8,"C";8.5,"C";8.3,"C"}, "score", "grp")
Expected output:
| A | B | mean_A | mean_B | diff | se | T | df | pval | hedges |
|---|---|---|---|---|---|---|---|---|---|
| A | B | 4.96667 | 6.46667 | -1.5 | 0.169967 | -8.82523 | 3.29756 | 0.00441722 | -5.76461 |
| A | C | 4.96667 | 8.26667 | -3.3 | 0.169967 | -19.4155 | 3.29756 | 0.000344895 | -12.6821 |
| B | C | 6.46667 | 8.26667 | -1.8 | 0.20548 | -8.75996 | 4 | 0.00207766 | -5.72198 |
Example 2: Unequal variance group spreads
Inputs:
| data | dv | between | |
|---|---|---|---|
| value | group | value | group |
| 10 | G1 | ||
| 10.1 | G1 | ||
| 9.9 | G1 | ||
| 12 | G2 | ||
| 13.2 | G2 | ||
| 11.5 | G2 | ||
| 14 | G3 | ||
| 16.5 | G3 | ||
| 15.2 | G3 |
Excel formula:
=GAMESHOWELL({"value","group";10,"G1";10.1,"G1";9.9,"G1";12,"G2";13.2,"G2";11.5,"G2";14,"G3";16.5,"G3";15.2,"G3"}, "value", "group")
Expected output:
| A | B | mean_A | mean_B | diff | se | T | df | pval | hedges |
|---|---|---|---|---|---|---|---|---|---|
| G1 | G2 | 10 | 12.2333 | -2.23333 | 0.507718 | -4.39877 | 2.05239 | 0.0828553 | -2.87326 |
| G1 | G3 | 10 | 15.2333 | -5.23333 | 0.724185 | -7.22651 | 2.02559 | 0.0327678 | -4.72034 |
| G2 | G3 | 12.2333 | 15.2333 | -3 | 0.880656 | -3.40655 | 3.5771 | 0.0665694 | -2.22515 |
Example 3: Cohen effect size option
Inputs:
| data | dv | between | effsize | |
|---|---|---|---|---|
| y | trt | y | trt | cohen |
| 2.1 | T1 | |||
| 2.2 | T1 | |||
| 2.8 | T2 | |||
| 3 | T2 | |||
| 3.7 | T3 | |||
| 3.8 | T3 |
Excel formula:
=GAMESHOWELL({"y","trt";2.1,"T1";2.2,"T1";2.8,"T2";3,"T2";3.7,"T3";3.8,"T3"}, "y", "trt", "cohen")
Expected output:
| A | B | mean_A | mean_B | diff | se | T | df | pval | cohen |
|---|---|---|---|---|---|---|---|---|---|
| T1 | T2 | 2.15 | 2.9 | -0.75 | 0.111803 | -6.7082 | 1.47059 | 0.0739488 | -6.7082 |
| T1 | T3 | 2.15 | 3.75 | -1.6 | 0.0707107 | -22.6274 | 2 | 0.00355557 | -22.6274 |
| T2 | T3 | 2.9 | 3.75 | -0.85 | 0.111803 | -7.60263 | 1.47059 | 0.0618101 | -7.60263 |
Example 4: Moderate differences among conditions
Inputs:
| data | dv | between | |
|---|---|---|---|
| metric | cond | metric | cond |
| 30.1 | C1 | ||
| 30.2 | C1 | ||
| 31 | C2 | ||
| 31.2 | C2 | ||
| 32.1 | C3 | ||
| 32.3 | C3 |
Excel formula:
=GAMESHOWELL({"metric","cond";30.1,"C1";30.2,"C1";31,"C2";31.2,"C2";32.1,"C3";32.3,"C3"}, "metric", "cond")
Expected output:
| A | B | mean_A | mean_B | diff | se | T | df | pval | hedges |
|---|---|---|---|---|---|---|---|---|---|
| C1 | C2 | 30.15 | 31.1 | -0.95 | 0.111803 | -8.49706 | 1.47059 | 0.0526599 | -4.85546 |
| C1 | C3 | 30.15 | 32.2 | -2.05 | 0.111803 | -18.3358 | 1.47059 | 0.0171749 | -10.4776 |
| C2 | C3 | 31.1 | 32.2 | -1.1 | 0.141421 | -7.77817 | 2 | 0.0293073 | -4.44467 |
Python Code
import pandas as pd
from pingouin import pairwise_gameshowell as pg_pairwise_gameshowell
def gameshowell(data, dv, between, effsize='hedges'):
"""
Run Games-Howell pairwise comparisons using Pingouin.
See: https://pingouin-stats.org/build/html/generated/pingouin.pairwise_gameshowell.html
This example function is provided as-is without any representation of accuracy.
Args:
data (list[list]): Input table where the first row contains column names.
dv (str): Name of the dependent-variable column.
between (str): Name of the grouping column.
effsize (str, optional): Effect size metric for pairwise contrasts. Default is 'hedges'.
Returns:
list[list]: 2D table containing Games-Howell pairwise comparison results.
"""
try:
def to2d(x):
return [[x]] if not isinstance(x, list) else x
def build_dataframe(table):
table = to2d(table)
if not isinstance(table, list) or not table or not all(isinstance(row, list) for row in table):
return None, "Error: data must be a non-empty 2D list"
if len(table) < 2:
return None, "Error: data must include a header row and at least one data row"
headers = [str(h).strip() for h in table[0]]
if any(h == "" for h in headers):
return None, "Error: header row contains empty column names"
if len(set(headers)) != len(headers):
return None, "Error: header row contains duplicate column names"
rows = []
for row in table[1:]:
if len(row) != len(headers):
return None, "Error: all data rows must match header width"
rows.append([None if cell == "" else cell for cell in row])
return pd.DataFrame(rows, columns=headers), None
def dataframe_to_2d(df):
out = [list(df.columns)]
for values in df.itertuples(index=False, name=None):
row = []
for value in values:
if pd.isna(value):
row.append("")
elif isinstance(value, bool):
row.append(value)
elif isinstance(value, (int, float)):
row.append(float(value))
else:
row.append(str(value))
out.append(row)
return out
frame, error = build_dataframe(data)
if error:
return error
if dv not in frame.columns:
return f"Error: dv column '{dv}' not found"
if between not in frame.columns:
return f"Error: between column '{between}' not found"
result = pg_pairwise_gameshowell(data=frame, dv=dv, between=between, effsize=effsize)
return dataframe_to_2d(result)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
Input table where the first row contains column names.
Name of the dependent-variable column.
Name of the grouping column.
Effect size metric for pairwise contrasts.