03 · What You Need to Know
How Range and Logic Checks Improve Research Data Quality
What Are Range Checks?
A range check evaluates whether a recorded value falls within a defined set of permissible or expected values.
For example, an assessment containing 40 equally weighted items scored as correct or incorrect should produce a total score between 0 and 40. A recorded score of 47 would violate the scoring rules.
Range checks may apply to numerical values, categorical codes, dates, or other structured information. They can prevent some invalid entries at the point of recording or identify records requiring investigation.
However, not every range is an absolute constraint. A value outside a commonly observed interval may be unusual without being impossible.
Researchers should therefore distinguish the theoretical limits of a variable from empirically expected values.
What Are Logic Checks?
Logic checks evaluate whether values are consistent with relationships, conditions, or sequences defined by the research protocol.
A logic check may compare several fields within one record or examine relationships across multiple records.
For example, if a study requires informed consent before research assessments begin, an assessment timestamp earlier than the recorded consent time may indicate a procedural or recording problem.
Similarly, a questionnaire may ask follow-up questions only when a participant selects a particular response. A record containing contradictory answers may require review.
Logic checks are especially valuable because individual values can appear plausible while their combination is inconsistent.
Range check
Evaluates whether an individual value falls within a defined permissible or expected set.
Logic check
Evaluates whether values satisfy specified relationships, conditions, or procedural sequences.
What Types of Validation Checks Can Be Used?
Range and logic checks belong to a broader family of data validation procedures.
| Check type |
Purpose |
Illustrative rule |
| Numeric range |
Identify values outside defined limits. |
A 40-item test score must fall between 0 and 40. |
| Permitted category |
Identify unsupported codes. |
Response codes must match the approved codebook. |
| Data type |
Verify the expected representation. |
A count must be recorded as an integer. |
| Required field |
Identify missing information required for a procedure. |
An assessment record must contain its authorized study identifier. |
| Chronological logic |
Evaluate event ordering. |
Follow-up assessment occurs after enrollment. |
| Conditional logic |
Evaluate responses dependent on earlier answers. |
A follow-up item appears only when applicable. |
| Cross-field consistency |
Identify contradictory information. |
Reported total equals the sum of component scores. |
| Uniqueness |
Identify potentially duplicated identifiers. |
One enrollment identifier corresponds to one study participant. |
| Cross-record consistency |
Evaluate relationships across records. |
A participant's assigned study group remains consistent in allocation records. |
Each rule should have a defined purpose. A large collection of poorly justified checks can create unnecessary alerts while failing to address the most consequential sources of error.
Why Perform Checks During Collection Rather Than Only During Cleaning?
Early validation creates an opportunity to correct some problems while the original source, collector, or participant interaction remains available.
For example, an incorrectly entered assessment score may be checked against the original scoring sheet immediately. Several months later, the source record might be unavailable or difficult to retrieve.
Early checks may also identify systematic problems, such as a defective questionnaire branch or an incorrectly configured scoring algorithm, before they affect a large number of participants.
However, validation during collection does not eliminate the need for subsequent data review. Some problems become visible only after records are combined, transformed, or examined across sites.
A defensible process therefore uses checks at suitable stages rather than relying exclusively on either real-time validation or final cleaning.
What Is the Difference Between a Hard Check and a Soft Check?
A hard check prevents a record from being accepted until a specified condition is satisfied. A soft check generates a warning but permits the value to be retained, sometimes with an explanation.
Hard checks may be appropriate for values that cannot exist under the defined measurement system, such as a score greater than the maximum possible score.
Soft checks may be more appropriate for unusual but potentially legitimate observations.
| Validation approach |
Suitable situation |
Potential limitation |
| Hard restriction |
A value violates a genuinely impossible condition. |
An incorrectly specified rule may prevent valid data entry. |
| Soft warning |
A value is unusual or requires confirmation. |
Warnings may be ignored if excessive or unclear. |
| Post-entry review |
The problem requires comparison with other records or source documents. |
Resolution may be delayed. |
| Conditional validation |
The acceptable value depends on another field or study phase. |
Incorrect logic can generate false alerts. |
The choice should follow the scientific meaning of the variable, not merely what the software makes easiest to implement.
How Should Valid Ranges Be Determined?
Valid ranges should be derived from instrument specifications, operational definitions, scoring rules, protocol requirements, or other defensible sources.
For example, the range of a Likert-type response coded from 1 to 5 follows the approved response categories. A scale total may have a different range depending on the number of items and treatment of missing responses.
Researchers should not automatically use the minimum and maximum values observed in a pilot sample as absolute limits for the main study.
Pilot data may help identify plausible values, but they do not necessarily establish what is possible in the target population.
Ranges should also account for units. A value recorded in centimeters may appear invalid if the system expects meters.
Should Extreme Values Be Automatically Rejected?
Not unless there is a defensible reason to establish that the value is impossible or invalid.
An unusually high response time, low achievement score, or unexpected behavioral frequency may be a genuine observation.
Automatically excluding such values can introduce bias, particularly when unusual observations are associated with the research phenomenon.
Researchers should distinguish an impossible value, a suspected recording error, and a statistically extreme but potentially valid observation.
Outlier identification and data exclusion are analytical decisions that may require separate justification and prespecification.
The principles for prespecifying data exclusion rules are relevant when validation findings could affect which observations enter the analysis.
How Should Missing Values Be Handled?
Missing information should not automatically be treated as an invalid entry.
A participant may decline to answer a question, an item may be inapplicable, or a technical problem may prevent measurement.
These situations can have different analytical implications and should be represented according to an approved coding scheme.
For example, a zero achievement score is not equivalent to a missing assessment. Replacing missing scores with zero would generally change the meaning of the data.
Electronic systems should distinguish required operational fields from research questions participants are permitted to skip.
Where participants may refuse particular questions, a hard validation rule requiring an answer could undermine voluntary participation.
How Do You Build Logic Checks for Longitudinal Research?
Longitudinal studies often require validation of participant linkage, assessment timing, and event sequences.
A participant may have baseline, intermediate, and follow-up records collected at different times.
Logic checks can identify missing identifiers, duplicated visits, inconsistent study assignments, or dates outside specified assessment windows.
However, a late follow-up may still contain useful information. It should not automatically be deleted merely because it occurred outside the intended window.
The protocol should specify how timing deviations will be documented and whether they affect the primary analysis.
Checks should also distinguish genuinely impossible sequences from unusual but explainable operational circumstances.
How Should Validation Work in Multisite Research?
Multisite studies benefit from common definitions and critical validation rules, particularly when data from several institutions will be combined.
Differences in local date formats, coding conventions, measurement units, and software configurations can introduce inconsistencies.
For example, one site might code an unanswered item as 0 while another uses a blank value. Combining those records without reconciliation could distort the dataset.
A shared data dictionary and centrally reviewed validation specifications can reduce these problems.
Site-specific checks may still be necessary where local procedures legitimately differ, but their implications for comparability should be documented.
How Should Automated Checks Be Tested Before Recruitment?
Validation rules should be tested using simulated or appropriately controlled test records before the principal study begins.
The test set should include valid values, invalid values, boundary cases, missing information, and combinations that trigger conditional logic.
For example, a test score validation should accept both the minimum and maximum legitimate scores while rejecting values outside those limits.
Researchers should also test whether warnings appear clearly, whether authorized exceptions can be recorded, and whether corrections are preserved appropriately.
Changes to forms or software should trigger relevant retesting. A validation rule that worked before an instrument revision may no longer be correct afterward.
Who Should Investigate Flagged Records?
Responsibilities should be established before collection.
A data collector may be authorized to correct an obvious transcription mistake after checking the source record. A more consequential discrepancy may require review by a data manager, supervisor, or principal investigator.
For example, an inconsistency between treatment assignment and intervention delivery should not be resolved simply by changing the assignment field to match the treatment received.
The original allocation record and implementation history may both be scientifically important.
The data quality plan should identify which discrepancies can be resolved locally, which require escalation, and who may authorize changes.
Should Original Values Be Preserved After Correction?
Yes, where feasible and appropriate to the data system and governance requirements.
An auditable correction process should preserve enough information to establish what was changed, why it was changed, and who authorized the action.
For example, a manually entered score corrected from 36 to 26 after checking the original assessment should have a documented explanation.
In electronic systems, audit trails may record the original value, revised value, timestamp, and responsible user.
In smaller studies, controlled correction logs and versioned datasets may provide proportionate traceability.
Silent overwriting makes it difficult to distinguish legitimate correction from undocumented alteration.
Can Validation Checks Introduce Bias?
Yes, particularly when validation rules are poorly designed or applied selectively.
A hard restriction may force participants to choose an inaccurate response when their actual circumstances fall outside the permitted categories.
Similarly, a collector may repeatedly question an unusual but legitimate answer, influencing the participant to change it.
Researchers should avoid treating expected values as necessarily correct or assuming that uncommon observations are mistakes.
Validation procedures should also be applied consistently across relevant participant groups and study conditions.
Where exceptions are permitted, they should be documented rather than concealed.
Are Range and Logic Checks Appropriate for Qualitative Research?
They may be useful for structured metadata, participant identifiers, dates, recording files, and other operational information.
However, qualitative narratives should not be forced into predetermined numerical or categorical limits merely to simplify validation.
For example, a qualitative interview record may require a valid participant code and recording date, but the participant's account may contain contradictions, ambiguity, or unexpected experiences that are analytically meaningful.
Such content should not automatically be treated as invalid data.
Quality assurance for qualitative material may instead emphasize accurate transcription, secure storage, contextual documentation, and methodological reflexivity.
How Often Should Validation Reports Be Reviewed?
The review frequency should reflect collection volume, the consequences of errors, and the opportunity for corrective action.
Critical automated restrictions may operate at every entry. Other checks may run daily, weekly, or at specified collection milestones.
For example, a short study collecting a few questionnaires may need periodic review, while a large multisite intervention may benefit from frequent monitoring of missing primary outcomes and inconsistent records.
Researchers should establish who reviews the reports, which alerts require immediate action, and how unresolved discrepancies are tracked.
The broader data quality assurance plan should coordinate these responsibilities.
How Much Validation Is Enough?
More rules do not necessarily produce better data.
Excessive warnings may create alert fatigue, while overly restrictive forms can prevent legitimate observations from being recorded.
Prioritize checks for variables whose errors could materially affect participant protection, primary outcomes, treatment assignment, record linkage, or important analysis decisions.
Lower-risk fields may require simpler validation and periodic review.
This approach aligns with risk-based prioritization of critical research variables.
Watch Out
A record that passes every range and logic check is not necessarily accurate or scientifically valid. A participant may provide an incorrect but plausible response, an instrument may measure the wrong construct, or a scoring algorithm may contain a systematic error. Validation checks complement, rather than replace, appropriate measurement and methodological quality assurance.