Tutorials › Biostatistics › Shift Tables for Laboratory Data

Clinical Safety Analysis

Shift Tables for Laboratory Data

A practical guide to baseline-to-post-baseline laboratory shift tables in clinical trials, including normal/abnormal status, CTCAE grades, treatment-emergent abnormalities, denominator selection, interpretation, data preparation, quality control, and implementation in R.

Intermediate20 min read

What You'll Learn

  • How laboratory shift tables summarize changes in patient status
  • How to define baseline and the post-baseline analysis value
  • How to build normal-to-abnormal and grade-to-grade tables
  • How to distinguish shift analyses from treatment-emergent abnormalities
  • How denominators affect percentages and interpretation
  • How to prepare laboratory data and create shift tables in R

Introduction

Laboratory data are collected repeatedly throughout a clinical trial. A conventional summary table can show the mean, standard deviation, minimum, and maximum at each visit, but these summaries do not always make it easy to see how individual patients changed relative to baseline.

A shift table addresses that question by cross-classifying a patient's baseline laboratory status against a defined post-baseline status.

Key idea: A shift table answers a transition question: where were patients at baseline, and where did they end up during the defined post-baseline period? The rows represent baseline categories and the columns represent post-baseline categories.

What Is a Shift Table?

A shift table is a cross-tabulation of two categorical states measured at different times. For laboratory safety reporting, the categories might be:

  • Normal vs. abnormal
  • Low / normal / high
  • CTCAE Grade 0 through Grade 4
  • Negative / positive
  • Within-range / below-range / above-range

The most important design decision is not the table itself. It is the definition of the baseline category and the post-baseline category that will be compared.

The Basic Structure

Baseline \ Post-BaselineNormalAbnormalTotal
Normal721890
Abnormal92130
Total8139120

In this example, 18 patients shifted from normal at baseline to abnormal after baseline. Nine patients shifted in the opposite direction. The table therefore describes transitions, rather than simply reporting the number of abnormal results.

Why Shift Tables Are Useful

Laboratory safety data often contain a large number of measurements. Reviewing every individual value is impractical in a standard clinical study report. Shift tables provide a compact patient-level summary that can highlight:

  • Patients who move from normal to abnormal
  • Patients whose baseline abnormalities improve
  • Patients whose abnormality worsens
  • Changes in toxicity grade
  • Laboratory parameters for which clinically important shifts are concentrated
Important: A shift table is a descriptive safety display. A shift from normal to abnormal does not, by itself, establish clinical significance, causality, treatment relatedness, or an adverse event.

Defining Baseline

Baseline should be defined according to the study's protocol, statistical analysis plan, and analysis dataset conventions. A common approach is the last non-missing, valid assessment before the first dose of study treatment.

The exact rule can differ when there are multiple assessments, unscheduled assessments, screening measurements, or assessments close to treatment initiation.

1
Identify the treatment start date/time according to the analysis convention.
2
Identify all eligible pre-treatment laboratory assessments.
3
Apply the prespecified baseline selection rule.
4
Assign the baseline laboratory value and category to each patient.

Defining the Post-Baseline Value

Unlike a simple visit summary, a shift table needs a specific rule for deciding which post-baseline observation represents the patient's status.

Common choices include:

  • Worst post-baseline value
  • Worst post-baseline CTCAE grade
  • Last available post-baseline value
  • A specific scheduled visit
  • A defined assessment window

For safety shift tables, worst post-baseline status is often useful because it identifies whether a patient experienced a deterioration at any point during the analysis period. However, the exact rule should be prespecified rather than chosen after reviewing the results.

Normal / Abnormal Shift Tables

A simple laboratory shift table can classify each result as normal or abnormal using the laboratory reference range and the study's analysis conventions.

Figure 1. Example Normal-to-Abnormal Shift Table
Simulated patient-level laboratory status. Percentages are calculated within baseline category.
BaselinePost-Baseline NormalPost-Baseline AbnormalTotal
Normal72 (80.0%)18 (20.0%)90 (100%)
Abnormal9 (30.0%)21 (70.0%)30 (100%)
Total8139120

The denominator for the percentages in this example is the baseline row total. Thus, 18 / 90 = 20.0% of patients who were normal at baseline became abnormal post-baseline.

Low / Normal / High Shift Tables

For quantitative laboratory tests with a lower and upper reference limit, a three-category shift table can be more informative than a binary normal/abnormal table.

Baseline \ Post-BaselineLowNormalHighTotal
Low148123
Normal10611384
High04913
Total247323120

This display can distinguish a patient who moves from normal to low from a patient who moves from normal to high. Both are abnormal, but they may have very different clinical interpretations.

CTCAE Grade Shift Tables

When laboratory abnormalities are graded using the applicable Common Terminology Criteria for Adverse Events (CTCAE), the categories can be expanded to represent severity.

A typical grade-based table may use:

  • Grade 0 — no CTCAE abnormality
  • Grade 1 — mild
  • Grade 2 — moderate
  • Grade 3 — severe
  • Grade 4 — potentially life-threatening

The exact grading algorithm depends on the laboratory parameter and the CTCAE version used by the study.

Figure 2. Example CTCAE Grade Shift Table
Simulated data for a laboratory parameter. Each row totals 100% within baseline grade.
Baseline \ Worst Post-BaselineGrade 0Grade 1Grade 2Grade 3Grade 4
Grade 05220710
Grade 1410520
Grade 212530
Grade 300121
Grade 400000

The table is particularly useful for identifying worsening severity. For example, a patient moving from Grade 0 to Grade 3 represents a more substantial safety shift than a patient moving from Grade 0 to Grade 1.

Reading the Diagonal

The diagonal of a shift table represents patients who remained in the same category.

Baseline category = Post-baseline category   →   no categorical shift

However, the diagonal should not automatically be interpreted as "no change." A patient may have moved substantially within the same category. For example, a laboratory value could change from barely normal to near the upper reference limit while remaining classified as normal.

Key limitation: Categorical shift tables intentionally discard some quantitative information. They should therefore be interpreted alongside continuous laboratory summaries and, where appropriate, individual patient listings.

Reading Off-Diagonal Cells

Cells away from the diagonal represent categorical transitions.

PatternInterpretation
Normal → AbnormalPatient newly enters an abnormal category
Abnormal → NormalPatient leaves an abnormal category
Grade 0 → Grade 1New mild abnormality
Grade 0 → Grade 2New moderate abnormality
Grade 0 → Grade 3/4New severe or more serious abnormality
Grade 1 → Grade 3Worsening by two CTCAE grades

Worst Post-Baseline Shift

For safety reporting, a common strategy is to assign each patient the worst post-baseline category observed during the defined period.

For example, suppose a patient has grades:

Grade 0 → Grade 1 → Grade 2 → Grade 1

The worst post-baseline grade is Grade 2. If the shift table compares baseline Grade 0 with worst post-baseline grade, that patient contributes to the Grade 0 → Grade 2 cell.

This approach summarizes whether a patient experienced a severe abnormality at any point, but it does not show when the abnormality occurred or how long it persisted.

Shift Tables vs. Treatment-Emergent Abnormalities

Shift tables and treatment-emergent abnormality summaries are related but answer different questions.

FeatureShift TableTreatment-Emergent Abnormality
Baseline comparisonExplicitly compares baseline and post-baseline categoriesOften based on whether a post-baseline abnormality occurred
Direction of changeYesUsually not the primary focus
Worsening categoryVisibleCan be summarized
ImprovementVisibleUsually not emphasized
TimingNot necessarily visibleNot necessarily visible

A patient can already be abnormal at baseline and remain abnormal post-baseline. That may appear on the diagonal of a shift table, while a treatment-emergent analysis may apply a different rule for determining whether the patient experienced a treatment-emergent abnormality.

Choosing the Denominator

Denominator selection is one of the most important technical decisions in a shift table.

If percentages are calculated within baseline categories, the denominator for each row is the number of patients in that baseline category.

Row % = Cell count ÷ Baseline-row total × 100%

For example, if 18 of 90 baseline-normal patients become abnormal:

18 ÷ 90 × 100% = 20.0%

This is usually easier to interpret than calculating percentages using the overall study population, because it answers the conditional question: among patients who started in this category, what happened afterward?

Missing Baseline Values

A patient without an evaluable baseline laboratory value may not be eligible for a baseline-to-post-baseline shift analysis.

The handling rule should be prespecified. Possible approaches include:

  • Exclude the patient from the shift table
  • Use a defined alternative baseline assessment
  • Display an explicit "Unknown" category
Best practice: Do not silently treat a missing baseline as normal. The correct handling depends on the analysis specification and the structure of the laboratory data.

Missing Post-Baseline Values

Missing post-baseline data create a different issue. If the table is based on the worst post-baseline value, a patient with no post-baseline assessment cannot have a worst observed post-baseline category.

The analysis population and denominator should therefore be defined explicitly. For example, the table may be based on all patients with both baseline and at least one post-baseline assessment, while another safety summary may use all treated patients.

Reference Ranges Matter

Normal/abnormal classification depends on the reference range used for the laboratory assessment. Reference ranges can vary by:

  • Laboratory
  • Test method
  • Units
  • Sex-specific reference range
  • Age-specific reference range
  • Study site

Therefore, the classification should generally be derived from the validated laboratory data and analysis conventions rather than by applying a single manually entered range to every record.

Unit Conversion

Before categorizing laboratory results, confirm that values are expressed in the expected analysis units.

Unit conversion errors can produce apparently plausible but incorrect shift classifications. A value may look reasonable numerically while being interpreted against an incompatible reference range.

QC check: Verify laboratory parameter, unit, lower reference limit, upper reference limit, and any grading inputs before generating the shift categories.

Laboratory Parameter Selection

Shift tables are commonly produced for clinically relevant safety laboratory parameters. The exact set depends on the protocol and SAP.

Laboratory DomainExamples
HematologyHemoglobin, hematocrit, neutrophils, lymphocytes, platelets
ChemistryALT, AST, bilirubin, creatinine, sodium, potassium
CoagulationPT/INR, aPTT
UrinalysisProtein, blood, glucose, ketones

The table should clearly identify the parameter, units, analysis population, baseline definition, post-baseline rule, and classification method.

Long-Format Data Structure

Long-format analysis data are convenient for deriving shift categories.

USUBJID   PARAM       ADY   AVAL   BASE   BSTAT   ASTAT
001       ALT         0     22     22     Normal  Normal
001       ALT         28    61     22     Normal  High
001       ALT         56    44     22     Normal  Normal
002       ALT         0     71     71     High    High
002       ALT         28    58     71     High    Normal

The exact variable names will depend on the study's analysis datasets. In a CDISC-oriented environment, the source variables and derivations should follow the study's established conventions.

Deriving the Shift Category

For a simple normal/abnormal analysis, a laboratory value can be classified using the applicable reference limits.

BSTAT =
  "Low"    if BASE < LNRLO
  "Normal" if LNRLO <= BASE <= LNRHI
  "High"   if BASE > LNRHI

ASTAT =
  "Low"    if AVAL < LNRLO
  "Normal" if LNRLO <= AVAL <= LNRHI
  "High"   if AVAL > LNRHI

The exact treatment of boundary values should follow the laboratory reference-range convention used by the study.

Data Preparation Workflow

1
Identify the laboratory safety analysis population.
2
Identify the analysis parameter and required unit.
3
Determine each patient's baseline laboratory assessment.
4
Classify the baseline result.
5
Identify eligible post-baseline assessments.
6
Apply the prespecified worst/last/visit-specific rule.
7
Classify the selected post-baseline result.
8
Cross-tabulate baseline and post-baseline categories.
9
Calculate counts and the specified percentages.
10
Validate the table against patient-level records.

R Implementation

A basic shift table can be created with dplyr and tidyr.

library(dplyr)
library(tidyr)

shift_tab <- data %>%
  count(BSTAT, ASTAT) %>%
  group_by(BSTAT) %>%
  mutate(
    pct = 100 * n / sum(n)
  ) %>%
  ungroup() %>%
  pivot_wider(
    names_from = ASTAT,
    values_from = c(n, pct),
    values_fill = 0
  )

Creating a Simple Count Matrix in R

shift_counts <- table(
  data$BSTAT,
  data$ASTAT
)

shift_counts

The resulting matrix can be formatted for a clinical study report using a reporting package or a study-specific table-generation framework.

Calculating Row Percentages in R

shift_pct <- prop.table(
  shift_counts,
  margin = 1
) * 100

round(shift_pct, 1)

Using margin = 1 calculates percentages within rows, which corresponds to percentages within baseline categories.

Worst Post-Baseline Grade

When the analysis requires the worst observed grade, first derive the patient-level worst grade and then join it to the baseline category.

worst_grade <- data %>%
  filter(POSTBL == "Y") %>%
  group_by(USUBJID, PARAM) %>%
  summarise(
    WORSTGR = max(CTCGR, na.rm = TRUE),
    .groups = "drop"
  )

shift_data <- baseline %>%
  left_join(
    worst_grade,
    by = c("USUBJID", "PARAM")
  )

In production programming, missing-value handling, ties, parameter-specific grading, and analysis flags should follow the study's validated derivation specifications.

Creating Treatment-Arm Shift Tables

For randomized trials, shift tables may be produced separately by treatment group.

shift_by_trt <- data %>%
  count(TRT01P, BSTAT, ASTAT) %>%
  group_by(TRT01P, BSTAT) %>%
  mutate(
    pct = 100 * n / sum(n)
  ) %>%
  ungroup()

Separate treatment-group tables make it easier to compare the distribution of laboratory changes, but the same baseline and post-baseline rules should be applied across treatment groups.

Example: ALT Shift Interpretation

Suppose a study produces the following simulated ALT table:

Baseline \ Worst Post-BaselineNormalHighTotal
Normal702090
High62430
Total7644120

Among the 90 patients who were normal at baseline, 20 became high during the post-baseline period. That is 22.2% of the baseline-normal subgroup.

20 ÷ 90 × 100% = 22.2%

However, this result should not be interpreted in isolation. The analyst should consider the magnitude of ALT elevations, timing, duration, concomitant laboratory abnormalities, clinical events, treatment exposure, and the study's prespecified safety analyses.

Shift Tables and Clinical Significance

A categorical shift does not tell you how large the underlying numerical change was. For example, two patients can both move from normal to high, even though one barely exceeds the upper reference limit and the other has a much larger elevation.

Therefore, shift tables are best considered one component of a laboratory safety assessment that may also include:

  • Descriptive statistics by visit
  • Maximum post-baseline values
  • CTCAE grade summaries
  • Treatment-emergent abnormality tables
  • Patient-level listings
  • Adverse-event summaries

Shift Tables and Hy's Law-Type Reviews

For liver safety assessments, shift tables may provide useful descriptive context, but they are not substitutes for the prespecified evaluation of clinically important hepatic laboratory patterns.

When reviewing ALT, AST, bilirubin, alkaline phosphatase, and related measures, the relevant analysis should use the study's defined criteria and clinical review process.

Do not infer a regulatory conclusion from a single shift cell. Laboratory safety signals generally require integrated review of multiple laboratory parameters, timing, baseline status, clinical events, and other available information.

Common Mistakes

  1. Using an undefined baseline. The baseline rule should be prespecified and reproducible.
  2. Mixing different analysis populations. The denominator must correspond to the stated population.
  3. Using the overall population as the row denominator without explanation. This can make within-category transitions difficult to interpret.
  4. Ignoring reference-range differences. Laboratory-specific ranges can affect classification.
  5. Applying a single grading rule to every laboratory parameter. CTCAE grading is parameter-specific.
  6. Treating the diagonal as proof that no numerical change occurred. Categories can hide substantial within-category changes.
  7. Calling every post-baseline abnormality treatment-emergent. Baseline status matters.
  8. Failing to define the post-baseline period. "Worst" is meaningless unless the observation window is specified.
  9. Ignoring missing assessments. Missingness affects both eligibility and denominators.
  10. Interpreting a shift as causality. A laboratory shift is descriptive and does not establish treatment relatedness.

Clinical Study Report Specifications

Before programming the table, define the specifications clearly.

SpecificationExample
PopulationSafety population
ParameterALT
BaselineLast valid pre-dose assessment
Post-baseline ruleWorst post-baseline category
ClassificationLaboratory reference range
RowsBaseline category
ColumnsWorst post-baseline category
Percent denominatorBaseline-category row total
Missing baselineExcluded unless otherwise specified
Missing post-baselineHandled according to SAP-defined analysis population

Quality Control

Shift tables should undergo both programming QC and clinical review.

1
Confirm the analysis population.
2
Verify the baseline selection for sampled patients.
3
Verify reference ranges, units, and parameter codes.
4
Confirm the post-baseline selection rule.
5
Independently reproduce selected shift cells.
6
Check that row percentages sum to approximately 100% after rounding.
7
Check that counts reconcile with the source population.
8
Investigate unexpected concentrations of missing or unknown categories.

Manual Validation Example

Suppose five patients have the following baseline and worst post-baseline ALT classifications:

PatientBaselineWorst Post-BaselineShift
001NormalNormalNormal → Normal
002NormalHighNormal → High
003NormalHighNormal → High
004HighNormalHigh → Normal
005HighHighHigh → High

The resulting count matrix should be:

Baseline \ Post-BaselineNormalHighTotal
Normal123
High112

Within the baseline-normal group, 2 of 3 patients shifted to high:

2 ÷ 3 × 100% = 66.7%

If the programmed table reports a different count, the patient-level derivation should be traced before the table is released.

Interpreting Treatment-Group Differences

Suppose a normal-to-high shift occurs in 20% of patients in one treatment arm and 8% in another. The difference may be noteworthy, but a shift table alone does not provide a formal treatment-effect test.

Consider:

  • Baseline imbalance
  • Sample size
  • Exposure duration
  • Number and timing of laboratory assessments
  • Concomitant medications
  • Missing data
  • Other laboratory parameters
  • Clinical context

Formal statistical comparisons, if required, should be defined separately in the analysis plan.

Shift Tables by Visit

A single worst-post-baseline table summarizes whether an abnormality occurred, but it loses the timing of the change.

For some analyses, visit-specific shift tables can be more informative:

Baseline → VisitNormal → NormalNormal → HighHigh → NormalHigh → High
Week 2888717
Week 48412915
Week 880161014

Visit-specific tables can reveal whether shifts emerge early, accumulate over time, or resolve during treatment.

Shift Tables and Laboratory Listings

A shift table is a summary. A patient listing is the detailed source for investigation.

When a potentially important cell appears in the table, reviewers may need to trace individual patients through their laboratory history. This is particularly important for severe grades or unexpected patterns.

What a Shift Table Does Not Tell You

  • Exact timing of the change
  • Magnitude of the numerical change within a category
  • Duration of the abnormality
  • Whether the abnormality caused symptoms
  • Whether the abnormality was treatment-related
  • Whether the abnormality was clinically significant
  • Whether a patient met a separate adverse-event definition

Those questions require other analyses and clinical review.

Shift Table vs. Descriptive Laboratory Summary

QuestionDescriptive SummaryShift Table
What was the mean value?ExcellentNo
What was the range?ExcellentNo
How many became abnormal?LimitedExcellent
Did baseline abnormalities improve?Not directlyExcellent
Did toxicity grade worsen?LimitedExcellent
When did the change occur?By visit, if summarizedNot necessarily

Practical Reporting Language

Suggested table footnote: Shift from baseline to worst post-baseline laboratory abnormality category. Percentages are based on the number of patients in each baseline category. Baseline is defined as the last valid assessment before first dose. Worst post-baseline category is based on all eligible post-baseline assessments during the prespecified analysis period.

The Most Important Concept

The central idea behind a laboratory shift table is simple: the table describes movement between categories, not simply the frequency of abnormal results.

That distinction is why baseline status is essential. A patient who is abnormal at baseline and remains abnormal is fundamentally different from a patient who begins normal and becomes abnormal during treatment.

Likewise, a patient who begins with a Grade 1 abnormality and reaches Grade 3 has experienced a different trajectory from one who remains Grade 1 throughout follow-up.

Bottom line: A well-designed laboratory shift table provides a compact patient-level view of baseline-to-post-baseline changes. Its value depends on a clearly defined baseline, a reproducible post-baseline rule, appropriate laboratory classification, transparent denominators, and careful QC. It should complement—not replace—continuous laboratory summaries, CTCAE analyses, treatment-emergent abnormality summaries, listings, and clinical review.

References

U.S. Food and Drug Administration. Guidance for Industry: The Clinical Laboratory Data Interchange Standards Consortium (CDISC) Standard for Clinical Data.
National Cancer Institute. Common Terminology Criteria for Adverse Events (CTCAE).
International Council for Harmonisation. ICH E3: Structure and Content of Clinical Study Reports.
International Council for Harmonisation. ICH E9: Statistical Principles for Clinical Trials.