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, R and SAS.
Guide to missing values
Marker definitions
The Golden Base 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 value cannot exist in this context. For example: the dose of a treatment that was not administered.
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 the Golden Base. 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 the Golden Base. 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.
The Golden Base CSV file uses commas as separators, and also as the decimal mark (in quotes, for example "12,5"). Columns that contain markers remain textual: after handling the markers according to the analysis plan, convert them to numbers (replacing the comma with a point) or dates. Preserve the format of identifiers whose leading zeros are significant.
Python / pandas
To import the CSV or Excel file with pandas:
import pandas as pd
na_values = ["", "nan", "NaN"]
# If you have a CSV file
df_csv = pd.read_csv(
"golden_base.csv",
decimal=",",
keep_default_na=False,
na_values=na_values,
)
# If you have an Excel file
df_excel = pd.read_excel(
"golden_base.xlsx",
keep_default_na=False,
na_values=na_values,
)Reference documentation
R
To import the CSV or Excel file in R:
# If you have a CSV file
df_csv <- read.csv(
"golden_base.csv",
dec = ",",
na.strings = c("", "nan", "NaN"),
check.names = FALSE
)
# If you have an Excel file
df_excel <- readxl::read_excel(
"golden_base.xlsx",
na = c("", "nan", "NaN"),
guess_max = 1048576
)Reference documentation
SAS
To import the CSV or Excel file in SAS:
/* If you have a CSV file */
filename gb "golden_base.csv" encoding="utf-8" lrecl=1048576;
proc import datafile=gb out=work.golden_base dbms=csv replace;
delimiter=",";
guessingrows=max;
getnames=yes;
run;
/* If you have an Excel file */
proc import datafile="golden_base.xlsx" out=work.golden_base dbms=xlsx replace;
getnames=yes;
run;