Skip to contents

This function adds an event index to each row of the expanded endpoints data.table. The event index is created based on variable-value pairs and singleton conditions that define specific events of interest within the dataset. This index can be used to identify events in the user-supplied criteria and/or statistical functions

Usage

add_event_index(ep, analysis_data_container)

Arguments

ep

A data.table that contains expanded endpoint definitions, typically the output from expand_over_endpoints. It assumes the inclusion of the columns pop_var, pop_value, period_var, period_value, endpoint_filter, endpoint_group_filter, and custom_pop_filter, which are used to define the conditions for event indexing.

analysis_data_container

A data.table containing the analysis data.

Value

A data.table similar to the input but with an additional event_index column, which contains the indices of events as determined by the specified conditions for each endpoint. The indices refer to the INDEX_ column in the clinical data. This INDEX_ column is created by chef when a user supplies a clinical dataset.