Prepare (and Expand) Endpoint for Statistical Analysis
Source:R/prepare_for_stats.R
prepare_for_stats.Rd
Prepares the endpoint data for ingestion by the user-supplied statistical function by expanding it based on the type of statistics to be performed. It expands the data according to the specified statistical type, which determines the grouping columns used for the expansion.
Usage
prepare_for_stats(
ep,
analysis_data_container,
fn_map,
type = c("stat_by_strata_by_trt", "stat_by_strata_across_trt",
"stat_across_strata_across_trt"),
data_col = "dat",
id_col = "strata_id"
)
Arguments
- ep
A
data.table
containing expanded endpoint definitions and associated data, typically the output fromapply_criterion_by_strata
.- analysis_data_container
data.table containing the analysis data.
- fn_map
A
data.table
mapping endpoint definitions to statistical functions.- type
A character string specifying the type of statistics for which the data is being prepared. Valid types are "stat_by_strata_by_trt", "stat_by_strata_across_trt", and "stat_across_strata_across_trt".
- data_col
The name of the column in
ep
that contains the ADaM dataset.- id_col
The name of the column in
ep
that contains the unique identifier for the strata.