Click on the magnifying glass to the right. Starting typing a topic you wish to learn about

Missing Data Codes

Initial Considerations

Fields that have a blank/missing value may be marked with a custom 'Missing Data Code' to note why the value is blank. These missing codes may be used to aid in data analysis by specifying why a field lacks a value. To enable this feature below, enter both the codes AND their labels for all the categories of missing data that you wish to use in this project. If no codes are entered, this feature will remain disabled.

The Process - Set Up

  1. During project development, navigate to your Project Setup page

  2. Select “additional customizations”

     

     

  3. Scroll to the Missing Data Codes section, add codes from the pre-defined list (recommended) or manually add your own codes. A code should be entered as the code + comma + label. Codes can only have letters, numbers, dots, dashes, and underscores (e.g., '-999, Not asked' or 'UNK, Unknown').

  4. Select the “save” button for the additional customizations screen

The Process - How to Use It

  1. After your missing data codes have been set up, you will see an 'M' icon next to each field when viewing a data entry form. Click the icon to open your list of missing data codes, and select one.

     

     

  2. Once selected, it will save the missing code as the literal data value for the field.

    1. You can see the missing code on the form:

       

    2. You can also see the missing code on data exports:

      The checkbox field [family] was exported, and you can see the 3 standard responses are blank for this participant (highlighted in blue), then the missing data codes for this field are highlighted in yellow, with '1' listed for “OTH” which was selected as the missing data code.

      If no missing data codes were selected for any participants for a field, only the standard responses will export for that field.

       

  3. Missing data codes can be manually entered as described above, or imported which is the recommended practice for large sets of codes needing to be assigned to many participants across multiple fields.

    1. Prepare an excel file with A1: record_id

    2. A2-# should have the participant ID numbers

    3. Columns B-# should have the field name(s) that you’d like to import Missing Data Codes as the 1st row

      1. all fields, except checkbox fields, should have their variable name typed as-is

        1. missing data codes should be typed in the rows beneath the variable name

      2. checkbox fields should have their variable name typed, followed by 3 underscores and the missing data code. (e.g. if the checkbox field’s variable name is family, and I want to import values for missing data code NA then I would type family___na)

        1. the value 1 should be typed beneath the variable-missing data code name

      3. An example is provided below that needs some missing data codes imported for a few records, with [email] as a text field , [family] as a checkbox field, and [utahn] as a radio field.

        Please note, if you are using a longitudinal design you’ll need redcap_event_name as column B. If you are using repeating instruments you’ll need redcap_repeat_instrument and redcap_repeat_instance as columns B and C.

    4. Save the excel file as a .csv

    5. Navigate to the data import on your REDCap left menu

       

    6. Import the .csv file

 

Additional Considerations

  • When defining your missing data codes, please keep in mind to make sure that your missing code should never clash/overlap with a real value on a field in your project. For example, it you have an integer field where '-999' is a possible value, then you should not use -999 as a missing data code. This is because REDCap will not be able to know if this is a real value or if it is a missing code used to denote that the field is blank.

  • Behavior with branching logic - If a field with data should be hidden by branching logic, REDCap will typically ask the user (except on surveys) if they wish to delete the data of the field being hidden. But if the field has a missing data code saved for it, it will hide the field but will not remove the missing data code.

  • Because missing data codes are stored as the literal field values, they may be used and referenced in logic throughout REDCap (i.e., logic for report filters, Data Quality rules, Survey Queue, Automated Survey Invitations, branching logic). For example, if you want to display a field on a form only if the previous field is blank and is marked with the missing data code 'NASK', your branching logic might be the folowing: [field] = 'NASK'. Additionally, a special function 'isblankormissingcode()' may be used in logic as a catch-all for determining if a field's value is truly blank or if it contains a missing data code. E.g. isblankormissingcode([age]), in which if age has a value of UNK (which might be a missing data code in a project), then it will return TRUE. And if the field has any non-blank/non-null value that is also not a missing data code, it will return FALSE.

  • By default, the missing data code functionality is enabled for ALL fields in the project, but it can be disabled on a field-by-field basis by adding the action tag @NOMISSING for an individual field, in which this will hide the 'M' icon for the field on the data entry form and thus prevent usage of the missing data codes for the field.

  • Please be aware that if you are exporting Missing Data Codes in your data into a statistical analysis package, the CSV data might not load correctly in R, SAS, or SPSS statistical analysis package and might throw an error. You might need to manually modify the syntax file before loading it into the stats package in order to allow your Missing Data Codes to be accepted for certain data types, such as date fields. Otherwise, you might want to try exporting your data without the Missing Data Codes.