Repeated Measures, Clustering, and Pseudoreplication
Upon completing this topic
You will be able to identify the connections between observations in repeated measures and clustered data. You will identify pseudoreplication, which overestimates the sample size by counting sub-level rows as independent units, and clarify the necessary questions before choosing between summarization, hierarchical models, or design improvements.
More rows do not necessarily mean more independent information
A single independent unit can generate multiple time points, multiple wells, or multiple images. Although the dataframe may contain many rows, they may not be independent of each other because they share values from the same higher-level unit. The core of repeated measures lies not in the number of rows, but in the connection structure.
Hierarchical schema
study_id → subject_id → timepoint → measurement_idVerify that each level corresponds to the actual study unit. If the treatment was assigned to subject_id but measurement_id is counted as independent replicates, pseudoreplication risk arises. Time points for the same subject share temporal order and common state.
Clustering is similar. If units share a common environment or processing step, such as batch, plate, or site, observations within the same cluster may be more similar to each other. Recording cluster ID as a simple categorical column is distinct from reflecting that correlation structure in the analysis.
Three directions for handling
If the purpose of replication is to reduce measurement error, you can summarize at the level of independent units. To model time- or cluster-specific changes, you can consider methods that reflect the hierarchical structure. If the design is unclear, first supplement the study records and data lineage.
No direction is a rule that automatically applies to all replicated data. Choose based on the outcome type, number of time points, missingness, assignment level, and questions, and document the rationale.
Checking structure in long format
Repeated measures data can be expressed in long format, recording subject_id, time, measurement_id, and outcome in a single row. The appearance of the same subject_id across multiple rows may indicate a repeated structure rather than a duplication error. Counting the number of time points and missing locations per subject_id first allows you to verify which higher-level units are incomplete.
Conversely, if only measurement_id exists without a higher-level unit ID, it is difficult to recover the independence structure. Before analysis, supplement the higher-level ID from raw data, lab notebooks, or plate maps; if it cannot be verified, do not arbitrarily assume independence.
Reporting the number of unique subject_id per group side-by-side with the total number of rows reveals the difference between the number of observations and the number of independent units. Specify which level the n in the results table counts in each table and figure.
Returning to research questions for interpretation
The question for repeated measures data is not "Are the means of all rows different?" but rather "How do we distinguish changes within independent units from differences between independent units?" Failing to distinguish these can lead to underestimating uncertainty.
Common failures
- Counting multiple time points of a subject as independent samples.
- Automatically treating wells on the same plate as independent.
- Arbitrarily averaging repeated values and losing time information.
- Automatically specifying mixed models without checking the structure.
Key takeaways
- The core of repeated measures and clustered data is the higher-level unit and connection structure.
- The number of rows may not equal the amount of independent information.
- Summarization, hierarchical models, and design improvements are determined by the question and structure.
Next topic
From the next section, we move to OLS, covariates, and diagnostics.
References
- Bioconductor OSTA experimental design: https://bioconductor.org/books/release/OSTA/pages/bkg-exp-design.html
The hierarchical schema and explanations in this section were written independently by BioStatPy.