Build metadata
Step 1: input the population and observation datasets
metadata <- meta_adam(
population = r2rtf_adsl,
observation = r2rtf_adae
)
Step 3: feed in the analysis plan to the existing metadata
metadata <- metadata |> define_plan(plan)
Step 4.1: define the key words in population & observation
metadata <- metadata |>
define_population(
name = "apat",
group = "TRT01A",
subset = SAFFL == "Y"
) |>
define_observation(
name = "wk12",
group = "TRTA",
subset = SAFFL == "Y",
label = "Weeks 0 to 12"
) |>
define_observation(
name = "wk24",
group = "TRTA",
subset = AOCC01FL == "Y", # just for demo, another flag shall be used.
label = "Weeks 0 to 24"
)
Step 4.2 define the key words in the analysis plans
metadata <- metadata |>
define_parameter(
name = "rel",
subset = AEREL %in% c("POSSIBLE", "PROBABLE")
) |>
define_parameter(
name = "aeosi",
subset = AEOSI == "Y",
label = "adverse events of special interest"
) |>
define_analysis(
name = "ae_summary",
title = "Summary of Adverse Events"
) |>
define_analysis(
name = "ae_specific",
title = "Summary of Specific Adverse Events"
)
Step 5: build the metadata
metadata <- metadata |> meta_build()
Create A&R grid
ar_grid <- data.frame(
title = spec_title(metadata),
filename = spec_filename(metadata),
function_name = metadata$plan$analysis,
population = spec_analysis_population(metadata)
)
ar_grid |>
mutate(across(everything(), ~ gsub("\n", "<br>", .x))) |>
gt::gt() |>
gt::fmt_markdown(columns = gt::everything()) |>
gt::tab_options(table.font.size = 15)
title | filename | function_name | population |
---|---|---|---|
Summary of Adverse Events Weeks 0 to 12 All Participants as Treated |
ae0summary0wk12.rtf | ae_summary | Population: SAFFL == ‘Y’ Observation: SAFFL == ‘Y’ |
Summary of Adverse Events Weeks 0 to 24 All Participants as Treated |
ae0summary0wk24.rtf | ae_summary | Population: SAFFL == ‘Y’ Observation: AOCC01FL == ‘Y’ |
Summary of Specific Adverse Events Weeks 0 to 12 All Participants as Treated |
ae0specific0wk120any.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: SAFFL == ‘Y’ |
Summary of Specific Adverse Events Weeks 0 to 24 All Participants as Treated |
ae0specific0wk240any.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: AOCC01FL == ‘Y’ |
Summary of Specific Adverse Events Weeks 0 to 12 All Participants as Treated |
ae0specific0wk120aeosi.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: SAFFL == ‘Y’ AEOSI == ‘Y’ |
Summary of Specific Adverse Events Weeks 0 to 24 All Participants as Treated |
ae0specific0wk240aeosi.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: AOCC01FL == ‘Y’ AEOSI == ‘Y’ |
Summary of Specific Adverse Events Weeks 0 to 12 All Participants as Treated |
ae0specific0wk120rel.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: SAFFL == ‘Y’ AEREL %in% c(‘POSSIBLE’, ‘PROBABLE’) |
Summary of Specific Adverse Events Weeks 0 to 24 All Participants as Treated |
ae0specific0wk240rel.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: AOCC01FL == ‘Y’ AEREL %in% c(‘POSSIBLE’, ‘PROBABLE’) |
Summary of Specific Adverse Events Weeks 0 to 12 All Participants as Treated |
ae0specific0wk120ser.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: SAFFL == ‘Y’ AESER == ‘Y’ |
Summary of Specific Adverse Events Weeks 0 to 24 All Participants as Treated |
ae0specific0wk240ser.rtf | ae_specific | Population: SAFFL == ‘Y’ Observation: AOCC01FL == ‘Y’ AESER == ‘Y’ |