Evaluate a comparison between events

evaluate_comparison(
  event_1 = NULL,
  event_2 = NULL,
  relationship = c("exists", "not_exists", "==", "!=", ">", ">=", "<", "<=")
)

Arguments

event_1

an extracted event returned by extract(). This event will be placed on the left hand side of the operator defined by the relationship argument.

event_2

an extracted event returned by extract(). This event will be placed on the right hand side of the operator defined by the relationship argument.

relationship

character vector length 1 describing the type of relationship to assert:

  • exists: both events exist at the same time (2d) or for the same episode(1d)

  • not_exists: both events do not exist at the same time (2d) or for the same episode(1d)

  • "==": event_1 == event_2

  • "!=": event_1 != event_2

  • ">": event_1 > event_2

  • ">=": event_1 >= event_2

  • "<": event_1 < event_2

  • "<=": event_1 <= event_2

Value

Details

Checks the relationship between two events of interest. This takes two forms depending upon whether or not the data items are of type 1d or 2d. In all cases, the function evaluates the functional relationship of event_1 test_relationship event_2, where test_relationship acts as an operator between the two.

1-dimensional events (time invariant)

These items are checked without reference to any timepoint.

2-dimensional events (time series)

These items are checked with respect to their timestamp, which is used to identify co-incident events that are suitable for comparison.

Examples of comparisons

  • systolic blood pressure is always above diastolic

  • mean blood pressure is always below systolic

  • all date time pairings exist for date and time of:

    • death

    • withdrawal

    • ready for discharge

    • brain stem death

See also