Variables
Define EnaResearch variables without code: metric summaries in a window, time to threshold, length of stay, event duration and time between two moments.
- Admin panel
A variable is a single value per participant for analysis: length of stay, surgery duration, mean heart rate in the 24 hours before surgery, time to first mobilization. You define variables on the study's Variables page without writing code. Each formula is versioned, values are computed from the data as it stood at a cutoff, and a value is left missing when there is not enough data, never filled with zero or an estimate.
Required role
- A member of the study team with the export permission (owners and researchers).
Variable types
| Type | What it computes | Example |
|---|---|---|
| Metric summary in a window | Mean, median, minimum, maximum, total or sample count of a measurement type in a window around an anchor | Mean heart rate in the 24 hours before surgery |
| Time to threshold | Time from the anchor to the first hour or day whose summary reaches a threshold | First hour with 100 steps after surgery (first mobilization) |
| Length of stay | Admission to discharge of the first valid hospital stay | Length of stay |
| Event duration | Start to end of the first completed record of an event type | Surgery duration |
| Time between two moments | End minus start; negative if the end comes first | Admission to surgery |
Anchors and moments can be Participation start, Hospital admission, Discharge, Event start or Event end (of a chosen event type).
Create a variable
Open the study → Variables → New variable.
Under General, enter the Name: the column name in files, lower-case letters, digits and underscores (for example preop_hr_mean). It cannot be changed later. Add a Label and an optional Description (no personal data).
Under Formula, choose the Type and fill in its fields. For a metric summary:
- Measurement type and Anchor,
- Window start and Window end with the Unit (hours or days). The window is relative to the anchor: −24 to 0 hours means the 24 hours before it. A day is a 24-hour period from the anchor.
- Summary (Mean, Median, Minimum, Maximum, Total or Sample count),
- Minimum completeness (%): the share of the window that must have data; below it the value stays missing,
- Include flagged data: off by default, so samples flagged as implausible or sudden jump are left out.
Save. The list shows the variable with its kind (Clinical, Derived or Derived event), a one-line summary of the formula and its version.
Preview
Click Preview to compute each participant's value with the current cutoff. Values are not stored. The preview covers active, completed and lost-to-follow-up participations and shows the value, the completeness and the anchor time. A missing value shows its reason: No anchor record, No end recorded, No data, Not enough data or Threshold not reached.
Versions
Changing the formula creates a new version; the label and description do not. Earlier versions never change, and datasets keep using the version they pinned. Archive removes a variable from the list; its versions are kept.
Variables can only use the study's permitted measurement types and clinical record scope.
Related articles
Can't find what you need?
Our support team can help, from setting up a study to exporting a dataset. Please include your organization code.
Clinical record import
Import hospital stays and clinical events into an EnaResearch study from a CSV file or a FHIR R4 Bundle, with a check run first and row-level errors.
Datasets and versions
Define measurement or variable datasets in EnaResearch - resolution, time, participants, period, events - and see how every scope change creates a new version.