Skip to main content
v2026.11,772 entries · CC-BY 4.0

Missing Data Codes in REDCap and How They Export

How REDCap’s Missing Data Codes module works, the default code list, and what actually happens to those codes in CSV, SPSS, SAS, R, and Stata exports.

Written and maintained by CASRAI Editorial Board

Last updated

A blank field in a REDCap record is ambiguous. It might mean the value genuinely doesn’t exist yet, that a participant skipped the question, that a coordinator forgot to enter it, or that the question was intentionally never asked because of an earlier branching-logic answer. REDCap’s Missing Data Codes feature exists to remove that ambiguity: instead of leaving a field blank, whoever enters data can select a short, project-defined code that records why the value is missing, without touching the field’s normal validation or its stored data type.

This guide covers what the feature actually does, how it’s set up at the project level, and — the part that catches people who only learn it from the data-entry side — how those codes behave once a project is exported to CSV or to REDCap’s auto-generated SPSS, SAS, Stata, or R syntax files.

What Missing Data Codes actually are

Missing Data Codes is an optional, project-level module in REDCap. When a project’s administrator turns it on and defines a code list (each entry is a short code paired with a label, e.g. NASK, Not asked), every eligible field on every form and survey in that project gains a small, separate control — distinct from the field’s own answer box — that lets the person entering data pick one of those codes instead of typing a value. Selecting a code does not put text into the field itself; REDCap stores the missing-code selection as its own piece of metadata attached to that field/record.

Two things this deliberately does not do, which is where most confusion starts:

  • It is not branching logic. Branching logic decides whether a field is shown at all; missing data codes are for a field the user can see and is choosing not to answer, or cannot answer, for a specific recorded reason.
  • It is not field validation. A field can have both a validation type (date, integer, phone) and a missing-code option at the same time — validation governs what counts as a well-formed answer; the missing code is the escape hatch for when there isn’t one.

Turning it on and defining the code list

Missing Data Codes is enabled per project from Project Setup, under the project’s additional customizations. Once enabled, the project sets its own code list — REDCap does not force a fixed vocabulary, and this is worth taking seriously rather than accepting a default without discussion, since the codes end up in every export a collaborator or a future you will have to interpret. Many projects converge on a small set that maps loosely to the “reason a value is absent” categories used elsewhere in clinical and survey data standards — commonly some combination of not applicable, not asked, asked but unknown/refused, and temporarily unavailable — but the exact codes and their labels are a project-level decision, and different REDCap installations and template libraries suggest different starting lists. Agree on the list, and its meaning, with whoever will analyze the data before data collection starts, not after.

Because the list is fully custom, don’t assume a code means the same thing across two different REDCap projects, even at the same institution — always check a project’s own data dictionary or its Missing Data Codes configuration screen for what a given code was defined to mean before interpreting exported data that uses it.

How a missing code looks during data entry

On a data entry form, an eligible field shows a small marker (typically rendered near the field) that opens the defined code list. Choosing a code visually indicates the field has been explicitly marked missing, as opposed to simply left blank — which matters for downstream data quality review, since REDCap’s Data Quality module and field-level required-field enforcement can be configured to treat “explicitly coded missing” differently from “never touched.” On REDCap’s public-facing surveys, the same mechanism is generally exposed as a way for a respondent to indicate why they’re not answering a question, subject to how the survey’s fields and requirement settings were configured.

What happens on export

This is the part that most often surprises someone using an already-built project rather than one they configured themselves.

  • Raw/CSV export. A field marked with a missing code does not export as an empty cell. It exports with the code itself as the field’s value — the same short code string the project defined (e.g. NASK), not the longer label. If you’re piping a raw REDCap export into analysis code that expects either a real value or a true blank, an unhandled missing code will land as a stray text value in what may otherwise be a numeric column, which is a common source of an import throwing a type error or, worse, silently coercing the column to text.
  • REDCap’s generated statistical syntax files. When you export a REDCap dataset with one of the accompanying statistical syntax files (SPSS, SAS, Stata, or R), REDCap writes the field’s value labels and, where the target package supports it, its missing-value declarations into that syntax file — the intent being that once you run the syntax against the raw data file, the package recognizes the project’s own value labels and, for packages with a native “user-defined missing” concept (SPSS and Stata both have one; SAS and R handle it differently), treats a missing code as missing rather than as an ordinary category. In practice, always open the generated syntax file and confirm how your specific missing codes were declared before trusting the result — the exact mechanics can differ by REDCap version and by how the missing codes were defined, and a code that isn’t handled the way you expect will quietly change your denominators.
  • The API. Missing codes come through the REDCap API the same way they come through a manual raw export — as the literal code string in the field’s value — so any pipeline that pulls data programmatically needs the same explicit handling as a manual CSV export, and needs it built in from the start rather than discovered after a script has been running for months.

Practical handling for an analysis pipeline

Whatever downstream tool receives the export — R, Stata, SPSS, Python — the codes need to be intercepted deliberately, not left for the tool to guess at:

  • Get the project’s current Missing Data Codes list (and each code’s exact meaning) before writing any cleaning script, from the project’s Missing Data Codes configuration screen or its data dictionary — never assume a default list.
  • Recode explicitly, rather than relying on a package’s own missing-value declarations to survive every step of a pipeline. A code that’s correctly flagged as missing in the first script that reads the file can silently become an ordinary text value the moment the data is re-saved or re-read by a different tool that doesn’t preserve those declarations.
  • Keep the code itself, don’t just convert straight to a blank/NA, until the analysis stage where the distinction genuinely doesn’t matter. Collapsing NASK (not asked) and ASKU/refused-type codes into the same undifferentiated missing value early throws away information a reviewer or a data-sharing statement may later need — for example, distinguishing structurally-missing (skipped by design) from respondent-refused matters for both response-rate reporting and for honestly describing a dataset in a data management plan or a repository’s metadata.

Frequently asked questions

Does a missing data code count as a “blank” for REDCap’s required-field checks?

No. Selecting a missing code satisfies REDCap’s own required-field enforcement — the field is treated as having been explicitly addressed, not skipped. That’s a deliberate design choice: the whole point of the feature is to distinguish “genuinely untouched” from “addressed, with a recorded reason it has no value.”

Can different fields in the same project use different missing code lists?

The code list itself is defined once per project and applies wherever the feature is turned on for a field; it isn’t independently customized field-by-field. If a project genuinely needs different missing-reason vocabularies for different instruments, that’s a data-dictionary design decision to make deliberately, not something the module does automatically.

Will a missing code break a calculated field?

A calculated field that references a field holding a missing code, rather than a numeric value, will not evaluate the way it would with a real number — treat any field feeding a calculation as needing an explicit missing-code check in the calculation logic or in downstream cleaning, the same way you’d handle any other non-numeric value landing in a numeric slot.

REDCap is the dominant electronic data capture platform in academic clinical and biomedical research, run by the non-profit REDCap Consortium rather than sold as a commercial product with public pricing — see CASRAI’s REDCap entry for the platform’s origin and access model, and the Research Tools & Software hub for how it compares to the other survey and data-collection platforms researchers use.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · included with Regulatory Radar

Ask about Missing Data Codes in REDCap and How They Export

Ask CASRAI answers research-administration questions and cites the passages behind every claim — and says so when the corpus does not cover something, instead of guessing. It comes with a Regulatory Radar subscription at $29 a month, alongside the daily digest of regulatory changes and the dashboard of what changed.

150 questions a day, on this site, over the API, or inside your own tools through the CASRAI MCP server.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Regulatory Radar

Stop finding out after the fact

$29/month, cancel anytime. Daily digest updates from our analysis, a dashboard holding the same items, and a cited assistant for everything they raise.

  • Federal Register, Federal Register+, Grants.gov, Regulations.gov, NSF News, UKRI, plus CASRAI’s own published content.
  • 72,264 indexed passages, and every answer cites the ones it drew on.