door_summary {door} | R Documentation |
Summarize individual level data into summary level data
Description
Transform an individual level dataset that contains DOOR outcome variable and treatment/intervention variable to summary level. By default, the levels of the DOOR outcome is ordered from 1 to K.
Usage
door_summary(
data,
trtVar,
doorVar,
trtCodes,
trtLabels = NULL,
compVars = NULL,
decreasing = FALSE
)
Arguments
data |
Data frame that includes DOOR outcome variable and treatment variable at individual level |
trtVar |
Variable name of treatments |
doorVar |
Variable name of DOOR outcome; the doorVar should be numeric |
trtCodes |
A numeric vector contains the codes for interventions in |
trtLabels |
An optional vector contains the intervention labels for |
compVars |
An optional character vector of variable names of DOOR components |
decreasing |
A logical value indicating the order of desirability of the DOOR levels. By default, smaller value represents better outcomes |
Value
An object of DOOR outcome distribution summary
Examples
data(mock_raw_data)
door_summary(data = mock_raw_data,
trtVar = "ARM",
doorVar = "DOOR",
trtCodes = c(1,2),
trtLabels = c("Test, Control"),
compVars = c("infectious complications", "clinical failure", "death"))