Preserve subtraction direction in a clinical change-score import

preserve-subtraction-direction-in-a-clinical-change-score-import

A CSV column named change hides a question: which number was subtracted from which?

Consider two synthetic teaching records, both describing a score moving from 8 at baseline to 5 at week 12. One source reports follow-up minus baseline: -3. Another reports baseline minus follow-up: +3. Loading those numbers into one unlabelled column creates an avoidable review problem. The sign is part of the source convention, not a standalone clinical interpretation.

The Cochrane Handbook describes both subtraction directions for change scores in section 6.5.1. Section 6.5.2.1 discusses extracting final measurements and change scores. Those formats can sometimes contribute to the same analysis under appropriate methods; a data importer should not make that decision simply because two values share a unit.

Keep the source value and make conversion explicit

The example below accepts a reported change, its verified subtraction definition, a scale unit, an assessment time and a source locator. It returns a new record with a separate followup_minus_baseline field. It never overwrites the reported number or guesses a missing definition.

The function is a small, dependency-free Python example. It does not retrieve papers, extract text, impute missing values or run a meta-analysis.

from math import isfinite


def normalize_change(row):
    """Synthetic import example, not a statistical analysis."""
    if not isinstance(row, dict):
        raise ValueError("record must be a dictionary")
    for field in ("endpoint", "unit", "timepoint", "source_locator"):
        if not isinstance(row.get(field), str) or not row[field].strip():
            raise ValueError(f"missing {field}")
    value = row.get("reported_change")
    if type(value) not in (int, float) or not isfinite(value):
        raise ValueError("reported_change must be a finite number")
    direction = row.get("subtraction")
    multipliers = {"followup_minus_baseline": 1,
                   "baseline_minus_followup": -1}
    if not isinstance(direction, str) or direction not in multipliers:
        raise ValueError("source subtraction direction is required")
    return {**row,
            "normalized_followup_minus_baseline": value * multipliers[direction],
            "sign_multiplier": multipliers[direction]}

Here are the two synthetic records:

base = dict(endpoint="synthetic pain score", unit="points",
            timepoint="12 weeks", source_locator="synthetic example Table 2")
a = dict(base, reported_change=-3, subtraction="followup_minus_baseline")
b = dict(base, reported_change=3, subtraction="baseline_minus_followup")
rows = [normalize_change(a), normalize_change(b)]
print([r["normalized_followup_minus_baseline"] for r in rows])
# [-3, -3]
print([r["reported_change"] for r in rows])
# [-3, 3]

The matching normalized values do not establish comparable populations, equivalent interventions or compatible outcome definitions. They only show the result of the two declared sign transformations. A separate reviewer still needs to verify the source definitions, the outcome scale, timepoint, analysis population and the intended synthesis method.

Failure cases matter more than convenient coercion

An empty source locator means the transformation cannot be traced. An unknown subtraction definition means the multiplier is unknown. A string such as "-3" may need a separately reviewed parsing step. None of those conditions should quietly become a numeric zero.

I ran this local example with both direction variants and a genuine zero. Eleven invalid inputs were rejected: a non-record input, a non-text direction, null, a Boolean, NaN, infinity, a numeric string, an unknown direction, an empty source locator, an empty timepoint and a blank unit. The original input dictionaries remained unchanged. These are software checks on synthetic records, not validation of an extraction from an actual clinical paper.

A useful review table keeps the source value, definition, locator, normalization rule and checked output visible together. An editor can then correct a definition without losing the original transcription. The code cannot tell whether a quotation from a paper was accurate: that remains a source-review task.

A small first research task

We are the RigorMed team. RigorMed is an AI research workspace for research planning, evidence review, supported analyses, manuscripts, figures and presentations. One practical starting point is a source-linked evidence table from 2-3 clinical papers you may lawfully use, with unresolved definitions retained for checking. Available source access, task requirements and credits still apply; the example above does not claim a production run or a customer result.

Method reference: Cochrane Handbook, Chapter 6, especially sections 6.5.1 and 6.5.2.1.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
quality-news-now-–-ep.-3

Quality News Now – Ep. 3

Next Post
good-news-about-jobs

Good News About Jobs

Related Posts