Data usage guide
Interpret missing values and prepare the data for analysis.
This guide explains missing-data markers, parent–child relationships, and import settings for Python and R.
Guide to missing values
Marker definitions
TraumaBase uses four markers to distinguish different meanings and sources of missingness. Their meaning should inform the analysis and the choice of a missing-data handling strategy, taking the missingness mechanism into account.
NDNot available (Non disponible)
The information is expected, but was not found in the patient record.
NANot applicable
The question or measurement does not apply in this context, often because of the answer to a parent question.
NRNot collected (Non renseigné)
The variable was not collected in this source or during this period.
IMPUnobtainable measurement (Imprenable)
A physiological measurement could not be obtained, for example because the signal was too weak or absent.
Handling missingness in analysis
NA: use the clinical context
An imputation based on the clinical meaning of the variable may be justified for NA. When the parent answer establishes that an event or treatment was absent, the expected value may be “No” or 0. For example, if a treatment was not administered, its dose is recorded as NA by default in TraumaBase. In this context, it can be imputed as 0 with reasonable confidence.
Parent–child relationships
In the electronic case report form (eCRF), an answer can open or close another question. The parent variable determines whether the child variable applies.
Physician-accompanied transport?
Imputation example: catecholamine dose
If no catecholamine was administered, the dose is recorded as NA in TraumaBase. The absence of treatment then supports imputing the dose as 0 for analysis.
ND, NR and IMP: statistical methods
For ND, NR and IMP (and the rare cases where NA cannot be imputed using a clinical hypothesis), choose a statistical method suited to the research question and the missingness mechanism. Depending on the context, this may include multiple imputation, estimation methods that account for missing data, and sensitivity analyses.
NR may affect an entire collection period; IMP may be related to the clinical condition.
Suggested resources for handling missing values
R-miss-tastic provides methods, references, tutorials, and examples in R and Python to help choose an appropriate approach to missing data.
Technical notes
The Golden Base contains the literal string "NA" for “Not applicable”. Some software automatically converts it to a generic missing value on import, losing this distinction. Preserve all four markers before preparing variables for analysis.
Python / pandas
To import a Golden Base CSV or Excel file, use keep_default_na=False to preserve the literal "NA" marker, and na_values to specify which values to convert to generic missing values. The dtype=str option imports columns as text.
import pandas as pd
na_values = ["", "nan", "NaN"]
df_csv = pd.read_csv(
"golden_base.csv",
sep=";",
keep_default_na=False,
na_values=na_values,
dtype=str,
)
df_excel = pd.read_excel(
"golden_base.xlsx",
keep_default_na=False,
na_values=na_values,
dtype=str,
)Only empty cells and the strings "nan" and "NaN" become generic missing values. The strings "NA", "ND", "NR", and "IMP" are preserved. dtype=str alone does not prevent "NA" from being converted.
Reference documentation
R
read.csv() also interprets "NA" as a missing value by default: set na.strings without including "NA". For Excel, readxl::read_excel() treats only blank cells as missing by default; the options below make the behaviour explicit and consistent with the pandas example.
df_csv <- read.csv(
"golden_base.csv",
sep = ";",
na.strings = c("", "nan", "NaN"),
colClasses = "character",
check.names = FALSE
)
df_excel <- readxl::read_excel(
"golden_base.xlsx",
na = c("", "nan", "NaN"),
col_types = "text"
)Adjust the delimiter and encoding to the file you received. After handling the markers according to the analysis plan, convert the relevant columns to numbers or dates; these examples deliberately import them as text.