03 · What You Need to Know
How to Verify a Research Data Analysis Pipeline Before the Main Study
What Is a Data Analysis Pipeline?
A data analysis pipeline is the sequence of procedures used to transform collected research information into analytic results.
Depending on the study, it may include importing data, checking records, cleaning errors, coding variables, constructing scores, merging datasets, applying statistical models, generating tables, and producing figures.
For example, a study of student engagement may import questionnaire responses, reverse-code selected items, calculate composite scores, link records across time points, and estimate associations between engagement and institutional support.
Each stage depends on the correctness of earlier procedures.
An error introduced during import may propagate through the entire analysis without generating a software warning.
What Is the Difference Between Dummy, Synthetic, and Pilot Data?
These terms are sometimes used interchangeably, but they can describe different kinds of test information.
Dummy or synthetic data
Artificially constructed records used to test whether procedures produce expected results under specified conditions. Synthetic data may be generated from rules, simulations, or models.
Pilot data
Observations collected through preliminary research procedures, potentially revealing realistic response patterns, missingness, measurement problems, and operational difficulties.
Synthetic data are especially useful when the researcher knows the correct output in advance.
Pilot data are useful for examining whether the pipeline can process information resembling what the definitive study is likely to generate.
Neither automatically establishes that the eventual analysis will be valid.
Why Should You Test an Analysis Pipeline Before the Main Study?
Early testing can identify technical errors, missing information requirements, and incompatibilities between the research instruments and planned analysis.
For example, a longitudinal model may require participant identifiers and assessment dates. If the data collection system does not preserve these fields, the planned analysis may become impossible.
A preliminary pipeline test can reveal this dependency before the main study begins.
It can also help estimate computational requirements, document transformations, and identify ambiguities in variable definitions.
Testing is therefore both a quality assurance activity and a way to evaluate whether the data collection design supports the intended analysis.
What Parts of the Pipeline Should Be Tested?
| Pipeline component |
What to verify |
Potential problem |
| Data import |
Whether files, variables, and values are read correctly |
Incorrect types, dates, or character encoding |
| Data cleaning |
Whether specified errors and inconsistencies are identified appropriately |
Valid observations are removed or errors remain undetected. |
| Missing-data handling |
Whether missingness is represented and processed as intended |
Missing values are interpreted as zeros or valid responses. |
| Variable coding |
Whether categories and labels retain their intended meaning |
Incorrect group assignment or response mapping |
| Score construction |
Whether item transformations and composite calculations are correct |
Reverse-coding or aggregation errors |
| Data linkage |
Whether records are matched to the correct cases |
Duplicate, missing, or incorrect matches |
| Statistical estimation |
Whether the specified model and estimand are implemented |
Incorrect formulas, variables, or analysis populations |
| Reporting |
Whether tables and figures reflect the computed results |
Mislabeling, rounding errors, or outdated outputs |
| Reproducibility |
Whether the workflow can be rerun consistently |
Undocumented manual changes or software dependencies |
The relevant components depend on the research design. A descriptive survey may require a relatively simple pipeline, while a longitudinal or multisite trial may require extensive verification.
How Can Synthetic Data Test Known Results?
Researchers can construct artificial records for which the expected result is known independently of the analysis code.
For example, a five-item questionnaire can be tested using responses whose correctly calculated composite score is known in advance.
If the pipeline produces a different score, the discrepancy indicates that at least one procedure requires investigation.
Similarly, researchers can create datasets with known group means, missing values, and duplicate identifiers to examine whether the workflow behaves as specified.
These tests are valuable because they evaluate correctness against explicit expectations rather than relying on whether the output appears plausible.
What Is a Unit Test in Research Analysis?
A unit test evaluates a specific component of code or a calculation using defined inputs and expected outputs.
For example, a function that reverse-codes a five-point scale should convert 1 to 5, 2 to 4, 3 to 3, 4 to 2, and 5 to 1.
A unit test can verify each mapping, including how missing and invalid values are handled.
Other tests may examine date conversion, duplicate detection, score aggregation, or category recoding.
Unit tests are especially useful for procedures that will be applied repeatedly to many records.
However, passing individual tests does not guarantee that the complete pipeline functions correctly when its components interact.
What Is Integration Testing?
Integration testing examines whether separate components of a workflow operate correctly together.
For example, a pipeline may import data correctly and calculate scores correctly when tested separately, but fail when imported values have an unexpected data type.
A combined test can reveal this interaction.
In a longitudinal study, researchers may test whether imported baseline and follow-up records can be linked and then processed by the intended statistical model.
Integration testing is particularly important when data move between software applications or when several research team members maintain different parts of the workflow.
Should You Test Missing-Data Handling?
Yes. Missing values are a common source of analytic errors.
For example, a spreadsheet may use 99 to indicate an unanswered item. If the analysis pipeline treats 99 as a valid response, descriptive statistics and composite scores may be severely distorted.
Researchers should test whether missing-data codes are recognized and whether different reasons for missingness are preserved where necessary.
However, technical handling of missing values does not establish that the chosen statistical approach to missing data is appropriate.
Methods such as complete-case analysis, multiple imputation, or likelihood-based estimation require assumptions that cannot be validated merely by running a script successfully.
Should You Test Reverse Coding and Composite Scores?
Yes, particularly when questionnaire scores depend on item transformations.
For example, a scale may contain positively and negatively worded items that require different coding directions.
A pipeline error can cause the resulting composite to represent something other than the intended construct.
Researchers should test the transformation using known responses and verify the scoring rules against the instrument documentation.
They should also establish how missing items affect score calculation.
Correct computation is necessary, but it does not independently establish that the composite score has adequate validity or reliability.
How Should Data Linkage Be Tested?
Data linkage involves matching records across files, time points, instruments, or research strands.
Researchers should create test cases with known matches, unmatched records, duplicates, and identifiers containing unusual formatting.
For example, a participant identifier beginning with zeros may be altered when imported as a numerical value.
If this occurs, the pipeline may fail to match the participant's baseline and follow-up records.
Researchers should verify expected record counts and inspect unmatched or multiply matched cases.
A successful merge command does not guarantee that the correct records were connected.
Can a Pipeline Produce Plausible but Incorrect Results?
Yes. Some errors do not cause software failures.
For example, a regression model may execute successfully even when the wrong outcome variable is selected.
A data cleaning script may remove legitimate observations because an incorrect range restriction was applied.
A group comparison may use an unintended reference category.
These errors can produce numerical results that appear reasonable.
Researchers should therefore verify not only whether the code executes, but whether it implements the intended analytic decisions.
Should You Test Statistical Model Assumptions Using Synthetic Data?
Synthetic data can help verify how a model behaves under specified conditions, including whether the estimation procedure recovers known parameters in controlled simulations.
However, this does not establish that the model's assumptions will hold for the definitive dataset.
For example, a linear regression script may recover the expected coefficient from simulated data generated under ideal assumptions.
The actual study may still involve nonlinear relationships, clustering, measurement error, or informative missingness.
Researchers should distinguish computational verification from empirical assessment of model assumptions.
Can Simulation Studies Help Evaluate an Analysis Plan?
Yes. Simulation can be useful when the analysis involves complex designs, small samples, clustering, repeated measurements, or nonstandard estimators.
Researchers can generate data under specified assumptions and examine properties such as bias, precision, confidence interval coverage, or convergence.
For example, simulations may help assess whether a proposed multilevel model performs adequately under plausible cluster sizes and intraclass correlations.
However, simulation findings depend on the scenarios and assumptions used to generate the data.
They should not be interpreted as guarantees of performance under conditions that were not examined.
Should You Run the Planned Analysis on Pilot Data?
Often, yes, when doing so can reveal whether the necessary variables, data structures, and computational procedures are available.
For example, a researcher may discover that a planned longitudinal model cannot be fitted because assessment dates were not recorded consistently.
A pilot analysis may also reveal numerical convergence difficulties or unexpected missingness.
However, pilot datasets are often too small to support stable estimates of substantive relationships.
Researchers should avoid using pilot statistical significance or favorable effect estimates as the principal basis for choosing the definitive analysis.
For related considerations, see Should You Test Your Planned Analysis on Pilot Data?.
Should Researchers Use Real or Synthetic Data First?
Synthetic data are often appropriate for initial technical verification because expected outputs can be defined and sensitive participant information need not be exposed.
Researchers can then use appropriately collected pilot data to examine realistic data characteristics and operational problems.
For example, synthetic records may confirm that a scoring function works correctly, while pilot responses may reveal that the actual questionnaire produces more missing data than anticipated.
The approaches are complementary rather than interchangeable.
The choice should depend on the uncertainty being investigated and the relevant data protection requirements.
Can Synthetic Data Fully Replace Realistic Pilot Data?
No. Synthetic data reflect the assumptions and conditions used to generate them.
They may fail to reproduce unexpected participant responses, institutional constraints, unusual distributions, or complex missing-data patterns.
For example, an artificially generated dataset may contain perfectly formatted dates, while actual records contain inconsistent time zones or manually entered values.
Researchers should include relevant edge cases in synthetic testing, but they should not assume that every possible real-world problem has been anticipated.
Where operational uncertainty is consequential, realistic pilot data may provide additional evidence.
Should You Test Qualitative Analysis Workflows?
Yes, when technical or organizational procedures could affect the qualitative analysis.
For example, researchers may need to verify that transcripts can be imported into qualitative analysis software, that document identifiers remain consistent, and that analytic memos are preserved.
However, qualitative analysis should not automatically be treated as a fixed computational pipeline.
Interpretive approaches such as reflexive thematic analysis involve evolving analytic judgments that cannot be validated through software tests alone.
Researchers should distinguish technical readiness from the quality of qualitative interpretation.
How Should Mixed-Methods Analysis Pipelines Be Tested?
Mixed-methods research may require quantitative and qualitative information to be connected through participant identifiers, cases, conceptual dimensions, or other integration mechanisms.
A preliminary test can examine whether the required information is available and whether intended comparisons can be constructed.
For example, a researcher may plan to integrate student survey profiles with follow-up interview accounts.
The pipeline should preserve the necessary linkage without exposing identifying information beyond approved access arrangements.
However, technically connecting datasets does not establish that the resulting mixed-methods interpretations are conceptually or methodologically defensible.
Should You Test Joint Display Generation?
Yes, when joint displays are planned and their construction depends on particular data structures.
Researchers can prepare a preliminary display using synthetic examples to identify which quantitative results, qualitative findings, and case identifiers will be needed.
For example, a joint display organized by participant profile may require a secure link between survey scores and interview materials.
Testing can reveal missing information requirements before data collection.
However, the final display should reflect the actual evidence and should not force findings into predetermined relationships.
See What Is a Joint Display in Mixed-Methods Research, and Should You Plan It Before Analysis?.
What Is Reproducibility in an Analysis Pipeline?
Computational reproducibility concerns whether the same data and specified procedures can produce the same analytic results under documented conditions.
Researchers should preserve relevant code, software versions, variable definitions, and processing decisions.
For example, a statistical table should be generated from documented analysis code rather than manually reconstructed without a traceable connection to the underlying calculations.
However, computational reproducibility does not automatically establish that the analysis is scientifically valid.
An incorrect analysis can be perfectly reproducible.
Should You Use Version Control?
Version control can help researchers track changes to analysis scripts, documentation, and selected configuration files.
It may be particularly valuable when several team members contribute to a project or when the analysis evolves over time.
Researchers should distinguish changes made to correct errors from changes that alter substantive analytic decisions.
Version control should not be used to expose confidential participant information.
Appropriate repositories, access controls, and institutional data management requirements remain important.
Should the Pipeline Be Tested by Another Researcher?
Independent review may identify errors overlooked by the original analyst.
For example, another researcher may examine the code, reproduce selected calculations, or independently verify critical outputs.
The appropriate level of review depends on the complexity and consequences of the analysis.
High-stakes or technically complex studies may benefit from independent programming or structured code review.
However, agreement between two analysts does not automatically establish that the chosen method answers the research question appropriately.
How Should You Test the Pipeline Without Compromising Blinding?
In randomized trials, analysts may need to test procedures without accessing information that could compromise prespecified blinding arrangements.
Synthetic data, masked group labels, or other approved approaches may permit technical verification.
Researchers should establish when allocation information may be accessed and who is authorized to do so.
Unblinded examination of preliminary treatment effects may influence subsequent analytic choices.
Testing procedures should therefore be coordinated with the trial protocol and statistical analysis plan.
Does Pipeline Testing Replace Preregistration?
No. Pipeline testing and preregistration serve different purposes.
Preregistration documents planned research questions, hypotheses, and analytic decisions before the relevant results are known, according to the applicable registration approach.
Pipeline testing examines whether the planned procedures can be implemented correctly.
Researchers can test code using synthetic data before finalizing a preregistered analysis plan.
However, using observed pilot effects to select favorable analyses may introduce data-dependent decisions that should be disclosed.
Technical readiness does not remove the need to distinguish confirmatory from exploratory analysis.
What If the Planned Analysis Fails on Pilot Data?
Researchers should identify whether the failure reflects a technical error, insufficient information, numerical instability, or an inappropriate analytic model.
For example, a model may fail because the pilot contains too few observations, not because the method would necessarily fail in the definitive study.
Alternatively, the failure may reveal that an essential variable was not collected.
The response should depend on the source of the problem.
Researchers may correct code, revise data collection procedures, reconsider model specifications, or seek statistical expertise.
Consequential changes should be documented and justified rather than concealed.
Should You Establish Acceptance Criteria for Pipeline Testing?
Yes, when the tests concern functions with defined expected behavior.
For example, a score calculation should match independently verified values, participant linkage should preserve known matches, and missing-data codes should be handled as specified.
These expectations can be established before executing the tests.
However, not every analytic procedure has a single known correct numerical output under real data conditions.
Researchers should distinguish deterministic correctness checks from methodological judgments about model suitability and inference.
How Should Pipeline Testing Be Documented?
Documentation should identify the data used, procedures tested, expected outputs, observed results, errors detected, and corrective changes.
Researchers may maintain test scripts, logs, data dictionaries, and version histories.
Where pilot data are used, the report should explain the limitations of conclusions drawn from preliminary observations.
The documentation should make it possible to understand what was verified and what remains uncertain.
Researchers should avoid stating that an analysis was validated merely because the software executed without errors.
Watch Out
Do not confuse a functioning analysis script with a valid research analysis. Code can execute successfully while using incorrect variables, unsuitable models, invalid assumptions, or inappropriate interpretations. Technical verification is necessary but does not replace methodological judgment.