View source: R/summary_utility_functions.R
| prepare_subgroup_data | R Documentation |
Splits a data frame into two subgroups based on a flag and treatment scale.
prepare_subgroup_data(df, SG_flag, est.scale, treat.name)
df |
Data frame. |
SG_flag |
Character. Name of subgroup flag variable. |
est.scale |
Character. Effect scale ("hr" or "1/hr"). |
treat.name |
Character. Name of treatment variable. |
List with subgroup data frames and treatment variable name.
df <- data.frame(
treat = c(0, 1, 0, 1, 0),
sg_flag = c(1, 1, 0, 0, 1)
)
result <- prepare_subgroup_data(df, SG_flag = "sg_flag",
est.scale = "hr", treat.name = "treat")
nrow(result$df_1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.