Designing Variables
Variables form the building blocks of databases.
Each variable should have:
Variable Name
Machine-readable identifier.
Examples:
- age_years
- weight_kg
- temp_c
Avoid:
- age
- age1
- weightnew
Variable Label
Human-readable description.
Example:
Weight of participant at enrollment (kg)
Variable Type
Examples:
- Text
- Numeric
- Date
- Time
- Categorical
- Calculated
Permissible Values
Example:
Sex:
1 = Male
2 = Female
3 = Unknown
Variable Naming Conventions
Consistent naming improves database quality.
Recommended conventions:
Use Lowercase
Good:
weight_kg
Bad:
WeightKg
Use Underscores
Good:
visit_date
Bad:
visitDate
Include Units
Good:
height_cm
weight_kg
temp_c
Avoid Spaces
Good:
blood_pressure
Bad:
blood pressure
Coding Standards
Standardized coding improves interoperability.
Examples include:
Sex
1 = Male
2 = Female
Outcome
1 = Alive
2 = Dead
Yes/No Variables
0 = No
1 = Yes
Using consistent coding simplifies analysis and data sharing.
Visit Schedules and Longitudinal Data
Clinical studies frequently involve repeated observations.
Example:
| Visit | Day |
| Screening | -7 |
| Enrollment | 0 |
| Follow-up 1 | 7 |
| Follow-up 2 | 28 |
| Endline | 90 |
Data managers must determine:
- Which variables repeat
- Which variables are collected once
- How repeat visits will be structured
In REDCap, repeated observations can be implemented using:
- Repeating instruments
- Longitudinal projects
Repeating events