Communicating results: tables, figures and honest uncertainty
Communicate results with appropriate scope and uncertainty: build a claim hierarchy, design tables with justified significant digits and not-rejected groups, make figures supporting a single claim, calibrate language, and write useful limitations.
After this lesson you can
- Build a claim hierarchy and assign each claim its main evidence.
- Design result tables with justified significant digits, a declared ± convention, and tied-best groups.
- Redesign a result figure to support one claim with visible uncertainty.
- Calibrate claim language such as proves, suggests, and is consistent with to the evidence.
- Write a concrete limitations section useful to the reader.
Before you start
A table shapes what the reader remembers
Imagine two methods reach 84.274% and 84.561% on a task and their standard errors are 0.34 and 0.41 percentage points. A table printing three decimals and bolding the larger suggests a fine ranking. Yet means are estimated with uncertainty and individual errors alone do not determine uncertainty of the difference: pairing also matters.
Printing precision and statistical precision differ. Nor is there a universal rule forbidding an extra digit: it can make operations reproducible. The issue is not to present it as decisive information and to retain original unrounded data for analysis.
There are two separate decisions. First, what quantity to estimate: for example, mean accuracy on a task or mean difference between two methods run under the same conditions. Second, how to show it: unit, digits, interval, and comparison. Rounding each replicate before averaging can change the result; rounding only output leaves calculation intact. If a column uses percent, express error in percentage points rather than fraction. A standard error of 0.0034 as a proportion equals 0.34 percentage points, not 0.0034 points.
The lab convention rounds standard error to one significant digit and presents the mean at the same decimal position. This is a transparent editorial choice, not a theorem making every later digit noise. Estimate and error are different variables, and in paired comparisons a small difference can be measured precisely even if individual means vary substantially. The table should therefore let the reader find uncertainty of the difference rather than infer it from mean decimals.
From a conclusion to its evidence
A hierarchy of claims organizes a central thesis, subordinate claims, and evidence for each. The claim-evidence map can be followed both ways: for each sentence ask which comparison supports it and, for each table, which sentence it supports.
For example, “the method reduces cost at comparable accuracy” needs two distinct forms of evidence: quality on a predefined metric with justified equivalence margin, and cost measured under a comparable protocol. An ablation can support a proposed mechanism, but a joint improvement does not by itself identify one component’s causal contribution. A table does not show that improvement generalizes to unobserved tasks.
Alongside each claim write its population, experimental unit, metric, main test, and limitation. If an interval cannot rule out an important effect in either direction, the conclusion may be that comparison is imprecise. That is useful information even without a victory.
A minimal evidence map can have four rows. The first links “B changes accuracy relative to A” to the paired difference and interval. The second links “B requires less compute” to cost measured with declared hardware, configuration, and unit. The third records a mechanism claim and points to an intervention distinguishing it from alternatives. The fourth limits extrapolation to unevaluated tasks and architectures. Without an intervention for the third, the study can report the observed pattern and propose a mechanism as a hypothesis, not a demonstrated cause.
Reading backward, every table or figure should have a role in the map. A sensitivity table can support stability within tested ranges; it does not establish stability at every possible value. A figure can be descriptive without answering a confirmatory hypothesis by itself. Separating main evidence and supporting analysis helps readers distinguish an observation selected after seeing data from a prediction registered beforehand.
The table as a contract
Results-table design makes unit, favorable direction, replicate count, and meaning of ± explicit. ”±” can be standard deviation across runs, standard error of the mean, or interval half-width; these differ. Review error-bar conventions and the significance report before comparing.
For independent replicates with sample deviation and size , estimated standard error of the mean is . A two-sided t interval for the mean, under normal replicates or as an approximation where appropriate, is . Its frequentist interpretation concerns procedure coverage under its assumptions, not posterior probability that an observed interval contains the parameter.
If seeds are paired so each pair shares relevant conditions, form and estimate error of from deviation of . The same seed identifier alone does not guarantee independent pairs or useful coupling: document what is shared. Seed variation also does not measure extrapolation uncertainty to other tasks.
Pairing’s benefit follows from difference variance: . When shared conditions induce positive covariance, variation of differences may be lower than for two independent groups. If pairs share only an arbitrary number rather than a variation source, there is no reason to assume the benefit. Nor can pairs be created after seeing results to appear more favorable: the rule belongs in the design.
Imagine two reports writing “84.3 ± 0.3”. One defines ± as standard deviation of eight seeds and the other as standard error of eight seeds. Although printed figures match, scales differ: the second standard error corresponds to estimated standard deviation approximately points if seeds are independent and the above definition is used. Neither bar automatically includes uncertainty from test examples, hyperparameter selection, or task choice. For a multi-task conclusion, also report the unit and resampling scheme used for aggregation.
The largest observed value must always win the table, even when methods are close. Selection on noise favors high estimates. An exploratory alternative marks methods for which a two-sided paired test against the observed winner is not rejected after multiplicity correction. Call this set not rejected, not “equivalent”: nonrejection does not prove equality or equivalence. Selecting the winner on the same data also invalidates a straightforward confirmatory interpretation as if the comparator had been fixed beforehand. For confirmatory inference, fix comparator and hypothesis family in advance or use independent selection and test data.
Holm’s (1979) correction orders p-values, compares the smallest with , and continues with decreasing denominators until the first nonrejection. It controls familywise error for a fixed family of tests with valid p-values without requiring test independence. It does not correct selection bias, invalid tests, or omitted comparisons.
With three prespecified tests and , sort p-values from smallest to largest. Compare the first with ; if rejected, the second with ; only if that is also rejected compare the third with . If the second is not rejected, stop even if the third is below 0.05. Ordering uses observed values, but the question family must be defined beforehand. The coding exercise checks precisely that stopping point.
Practical equivalence answers another question. Before seeing results, fix a margin representing a relevant difference in application units. An equivalence test or interval compatible with its criteria can support that the difference lies within the margin under procedure assumptions. Without that margin, “not rejected” can include both small differences and substantial effects the study could not detect. Do not use shared bolding to turn low power into an equality claim.
One figure, one question
A figure as an argument selects a comparison and makes observations and uncertainty visible. Before opening Matplotlib, write the sentence a reader should be able to check from the figure. Rougier, Droettboom, and Bourne recommend adapting each figure to its message and audience.
Scale must make the question readable: in length bars an omitted zero can exaggerate magnitude; in points with intervals a truncated axis may help if declared and it does not hide the relevant reference. Seven colors are unnecessary for one comparison. Keep nearby labels, units, a legend for multiple series, and a caption explaining population, unit, interval construction, and main reading. Learning curves should say whether bands summarize seeds or mean intervals; performance profiles need threshold and unit. Also see publication figures and uncertainty visualization.
Before drawing, identify the contrast the reader must make. To compare methods by seed, connect each pair with a line and add a difference visualization if pair count permits. For a training trajectory, align time axes and explain whether every step uses the same runs and whether hyperparameters were selected on independent data. A pointwise 95% band at every step is not itself a simultaneous 95% band for the whole curve. Selecting the best time after inspecting the trajectory is also part of analysis.
A profile figure can show the fraction of tasks whose score reaches each threshold. The horizontal axis defines threshold and the vertical axis task fraction, so raising the threshold cannot increase the fraction. Task scales must be comparable or normalized by a declared criterion; a task with one hundred times more examples does not receive one hundred times more weight unless that is the question. A profile complements but does not replace per-task observations: one aggregate can hide deterioration exactly where the application matters most.
The verb has a scope
Calibrated language matches strength and population to evidence. “Proves” may suit a theorem under explicit assumptions; a finite experiment with wide intervals usually justifies “is compatible with” or “suggests”, followed by precise context. “Not significant” does not mean “no effect”, and an interval including zero does not prove equality. Communicating uncertainty requires plausible magnitudes, not just a p threshold.
A useful limitations section identifies a threat, possible direction or uncertainty, practical consequence, and future test. “We evaluated one architecture and task; we do not know whether improvement persists with others” helps a reader decide whether to extrapolate. “More research is needed” alone says neither where nor why. Also state resources, excluded population, label dependence, or tuning-budget sensitivity where relevant; do not promise a threat changes the result in a direction without checking.
Write a limitation as a chain: observed condition, threat, consequence for the decision, and next check. For example, with unequal tuning budgets, a reader cannot attribute advantage solely to the algorithm. Equal-budget evaluation could investigate that explanation; until then, avoid claiming the advantage will vanish. If data come from one institution, identify represented and excluded populations. If too few replicates exclude relevant effects, show the interval and practical scale of those effects.
Not every limitation relates equally to every application. Corpus provenance may be decisive when transferring a method to another language; missing cost measurements may be decisive for resource-constrained deployment. Prioritize limitations changing a reasonable reader’s decision and distinguish those measured from hypotheses. The section’s purpose is to let another person assess evidence scope, not protect the author with generic wording.
Lab: a reproducible table
We generate synthetic data by a declared formula to practice the workflow, not attribute performance to real methods. Each row is a run and each seed appears in every method. The example uses three methods and eight seeds. Code requires a complete unique panel and applies two-sided paired t-tests. Each mean interval summarizes seed variation; the difference test uses pairs. Values are fixed to illustrate calculation and are not a random sample verifying coverage. In a real study validate independence, unit, error model, and plan before interpreting p.
import numpy as np
import pandas as pd
from scipy import stats
seeds = np.arange(8)
base = np.array([-1.2, -0.5, 0.1, 0.4, 0.9, 1.1, -0.7, -0.1])
offsets = {'A': 0.0, 'B': 0.35, 'C': 0.50}
patterns = {'A': np.zeros(8),
'B': np.array([0.2, -0.1, 0.1, -0.2, 0.1, 0.0, -0.1, 0.0]),
'C': np.array([-0.1, 0.2, -0.2, 0.1, -0.1, 0.1, 0.0, 0.0])}
df = pd.DataFrame([{'tarea': 'T1', 'semilla': int(i), 'metodo': m,
'score': 80 + base[i] + delta + patterns[m][i]}
for m, delta in offsets.items() for i in seeds])
print(df.groupby('metodo').score.agg(['mean', 'std', 'count']).round(4))The following procedure is exploratory because it selects the best and compares it on the same sample. A nonrejected p-value enters the not-rejected set; its members are not called equivalent. The example handles exactly constant differences, where conventional t has zero variance: it returns p=1 if all zero and p=0 if a nonzero constant. Outside this degenerate model investigate the data process rather than infer automatically.
import math
def paired_p(a, b):
d = np.asarray(a, dtype=float) - np.asarray(b, dtype=float)
if np.allclose(d, d[0], rtol=0, atol=1e-12):
return 1.0 if abs(d[0]) < 1e-12 else 0.0
return float(stats.ttest_1samp(d, 0).pvalue)
def tied_best_group(scores, alpha=0.05):
if (not 0 < alpha < 1 or scores.shape[0] < 2 or scores.shape[1] < 1
or not scores.columns.is_unique or not scores.index.is_unique
or not np.isfinite(scores.to_numpy(dtype=float)).all()):
raise ValueError('Se requieren al menos dos pares completos y 0 < alpha < 1')
best = scores.mean().idxmax()
comparisons = [(name, paired_p(scores[best], scores[name]))
for name in scores.columns if name != best]
ordered = sorted(comparisons, key=lambda pair: pair[1])
rejected = set()
for rank, (name, p) in enumerate(ordered):
if p <= alpha / (len(ordered) - rank):
rejected.add(name)
else:
break
return set(scores.columns) - rejected
def table_latex(frame, alpha=0.05):
if frame.duplicated(['tarea', 'semilla', 'metodo']).any():
raise ValueError('Hay filas duplicadas')
lines = [r'\begin{tabular}{ll}', r'\toprule',
r'Método y tarea & Media e IC 95\% \\', r'\midrule']
counts = []
for task, group in frame.groupby('tarea', sort=True):
wide = group.pivot(index='semilla', columns='metodo', values='score')
counts.append(f'{task}: n={len(wide)}')
keep = tied_best_group(wide, alpha)
for name in wide.columns:
values = wide[name].to_numpy()
se = stats.sem(values)
half = stats.t.ppf(0.975, len(values)-1) * se
# Una cifra significativa para el error estándar, como convención de presentación.
digits = max(0, -math.floor(math.log10(se))) if se > 0 else 2
mean_text = f'{values.mean():.{digits}f}'
interval_text = f'[{values.mean()-half:.{digits}f}, {values.mean()+half:.{digits}f}]'
label = f'{name} ({task})' + ('*' if name in keep else '')
lines.append(f'{label} & {mean_text} {interval_text} ' + r'\\')
lines.extend([r'\bottomrule', r'\end{tabular}',
r'{\par\smallskip\footnotesize Medias e intervalos t del 95\%; ' + ', '.join(counts)
+ r'. *: no rechazo exploratorio pareado con Holm frente al máximo observado, no equivalencia.\par}'])
return '\n'.join(lines)
wide = df.pivot(index='semilla', columns='metodo', values='score')
print('No descartados:', sorted(tied_best_group(wide)))
print(table_latex(df))The table needs the LaTeX package booktabs. The star marks only the exploratory not-rejected set against the observed maximum. The generated note includes pair count per task, 95% t mean interval, and paired Holm test; for a real table add unit, family, and that higher metric values are better. The generator does not escape arbitrary LaTeX names: use controlled labels or escape them before export. Output retains original results in df; only presentation is rounded. If tasks have different scales, generate a table per task rather than averaging incompatible metrics directly.
The pandas Styler.to_latex API handles formatting and export, not statistical design. Because Styler needs Jinja2, this comparison runs in the local lab with pandas and Jinja2 installed. Reconstruct the same data because runtimes do not share memory. It does not turn a cell into a significance conclusion:
import numpy as np
import pandas as pd
base = np.array([-1.2, -0.5, 0.1, 0.4, 0.9, 1.1, -0.7, -0.1])
offsets = {'A': 0.0, 'B': 0.35, 'C': 0.50}
patterns = {'A': np.zeros(8),
'B': np.array([0.2, -0.1, 0.1, -0.2, 0.1, 0.0, -0.1, 0.0]),
'C': np.array([-0.1, 0.2, -0.2, 0.1, -0.1, 0.1, 0.0, 0.0])}
df = pd.DataFrame([{'metodo': m, 'score': 80 + base[i] + delta + patterns[m][i]}
for m, delta in offsets.items() for i in range(8)])
summary = df.groupby('metodo').score.agg(['mean', 'std', 'count'])
print(summary.style.format(precision=2).to_latex(hrules=True))npm run lab and open the connection link.To extend researchkit, download researchkit_tables.py and place it alongside researchkit.py from the first lesson. Locally you can import table_latex from researchkit_tables; the file does not modify base-module classes. This page’s cells are self-contained because browser sessions are independent across lessons. Install NumPy, SciPy, and pandas to use the add-on locally.
Lab: three questions, three figures
The next dataset is also defined by formula. It shows three epochs, eight seeds, and three methods. Bands are pointwise t intervals for the mean, not simultaneous bands. The paired panel retains seed correspondence. The profile indicates fraction of tasks whose value reaches a threshold without weighting by example count: define it before choosing the relevant summary. The lesson on robust aggregate metrics compares other summaries.
import matplotlib.pyplot as plt
epochs = np.array([1, 2, 3])
curves = np.array([[70 + 2*e + b + 0.25*e*b for e in epochs] for b in base])
mean = curves.mean(axis=0)
half = stats.t.ppf(0.975, len(base)-1) * curves.std(axis=0, ddof=1) / np.sqrt(len(base))
fig, axes = plt.subplots(1, 3, figsize=(12, 3.5))
axes[0].plot(epochs, mean, label='Media')
axes[0].fill_between(epochs, mean-half, mean+half, alpha=0.2, label='IC puntual 95%')
axes[0].set(xlabel='Época', ylabel='Puntuación', title='Evolución')
axes[0].legend()
for i in range(len(seeds)):
axes[1].plot([0, 1], [wide['A'].iloc[i], wide['C'].iloc[i]], color='0.65', marker='o')
axes[1].set(xticks=[0, 1], xticklabels=['A', 'C'], ylabel='Puntuación', title='Pares por semilla')
values = np.array([0.4, 0.5, 0.7, 0.8])
thresholds = np.linspace(0, 1, 101)
axes[2].plot(thresholds, [(values >= t).mean() for t in thresholds])
axes[2].set(xlabel='Umbral de puntuación', ylabel='Fracción de tareas', ylim=(0, 1.05), title='Perfil')
fig.tight_layout()
plt.show()Suggested captions: “Mean score rises in the synthetic model; band: pointwise 95% t CI of eight seeds.” “Each line connects the same seed between A and C; dispersion of differences appears in the slopes.” “Fraction of four synthetic tasks with score at least the threshold.” No figure establishes a trend for external tasks.
Exercises
Exercise sources: A, source extraction in news; B, historical-document analysis; C, language-model self-correction.
tied_best_group(scores, alpha). You receive a complete DataFrame with seeds as rows and methods as columns, with at least two pairs. Choose the highest mean, test each paired difference with a two-sided t-test, and apply Holm. Return the not-rejected set including the winner. For constant differences return p=1 if zero and p=0 otherwise. The result is exploratory because the winner was selected on the same data.def tied_best_group(scores, alpha=0.05):
passholm(pvalues, alpha): receive a list of valid p-values in original order and return indices rejected by Holm. Stop at the first nonrejection.def holm(pvalues, alpha=0.05):
passSummary
A table communicates a convention, a figure answers a question, and a limitation identifies a decision the evidence cannot yet support. Retain unrounded data and separate exploratory selection, confirmatory testing, and practical equivalence.