Compare like-for-like effects on one scale and explain what each interval and marker means.
Forest plots: align estimates, intervals and the no-effect value
Choose one effect measure
A forest plot places estimates on a shared horizontal scale with an interval beside each estimate. Mean differences, risk ratios and odds ratios cannot be mixed as though their numbers shared a unit. State the effect measure, population, comparison direction and interval method before plotting. The no-effect value is zero for an additive difference and one for a multiplicative ratio. A log-scaled ratio axis often makes equal proportional changes on either side of one visually comparable; it cannot accept zero or negative endpoints. Signed differences have a different zero reference and should not inherit ratio-axis labels.
Keep the interval type attached
A horizontal line may be a confidence interval, a credible interval, a sensitivity range or something else. Say which. Do not infer that a row with an interval touching the no-effect line is equivalent to a row with a wide interval far beyond it. Both estimate magnitude and precision matter. Asymmetric error bars explain why endpoints must be kept as numbers, not reconstructed from a visual radius. When an interval exceeds the plot boundary, use a clipped-end marker and print its true endpoint. Never replace the endpoint with the axis maximum in the underlying data.
Marker area needs a contract
A larger square can indicate greater analytic weight, sample size or merely visual emphasis. Those are not interchangeable. If marker area represents a weight, name the weighting method and provide the numeric weights. A pooled estimate at the bottom is a separate calculation, not the average of x positions on the screen; omit it when the included rows are not meaningfully combinable. Area-scaled symbols follow the same rule: doubling a marker radius quadruples its area. A plain point estimate with equal marker size is safer when weights are not part of the analysis.
Sort without changing meaning
Sorting rows by effect size can make a striking ladder but may hide prespecified groups or study chronology. Declare the row order, retain stable IDs, and distinguish subgroups without implying that adjacency is evidence of similarity. A plot of model variants should note which intervals are correlated because they share data; counting each variant as an independent result overstates evidence. Uncertainty and sample-size displays help explain sparse rows. Supply an accessible table with row ID, estimate, lower and upper bounds, unit, interval type and weight, then compare the chart against that table before publishing.
Worked contract
from math import isfinite, log
def ratio_forest_positions(
rows: list[tuple[str, float, float, float]]
) -> list[tuple[str, float, float, float]]:
names = [name for name, _, _, _ in rows]
if len(names) != len(set(names)) or any(not name for name in names):
raise ValueError("row names must be unique and nonempty")
output = []
for name, estimate, lower, upper in rows:
if not all(isfinite(value) and value > 0
for value in (estimate, lower, upper)):
raise ValueError("ratio estimates and endpoints must be positive")
if not lower <= estimate <= upper:
raise ValueError("estimate must lie within its interval")
output.append((name, log(estimate), log(lower), log(upper)))
return output
depot_comparisons = ratio_forest_positions([
("north depot", 1.25, 1.06, 1.47),
("south depot", 0.80, 0.65, 1.03),
])
assert depot_comparisons[0][1] > 0
assert depot_comparisons[1][1] < 0
assert log(1) == 0Performance and operating cost
Validating and transforming N rows takes O(N) time and O(N) output space. The code prepares positive ratio estimates for a log axis; it does not calculate intervals, pool rows or assign weights. Keep original ratio values in the export because logarithmic positions are drawing coordinates. If a row has a zero, negative or undefined ratio, investigate the estimator rather than forcing it onto the log plot.
Common Mistakes
- Mixing additive differences and ratios on one unlabeled axis.
- Drawing the no-effect line at zero for a raw ratio plot.
- Using square size as weight without stating the weighting rule.
- Silently truncating interval endpoints or treating related model variants as independent studies.
Validation drill
Compare 47 depot-level rate ratios with intervals. Identify rows that need clipped-end markers, then explain why a pooled diamond should not be drawn until the estimands and weights are reviewed.
