adsl <- forestly_adsl
adae <- forestly_adae
adsl$TRTA <- factor(adsl$TRTA, levels = c("Placebo", "Xanomeline Low Dose"))
adae$TRTA <- factor(adae$TRTA, levels = c("Placebo", "Xanomeline Low Dose"))
meta <- meta_adam(population = adsl, observation = adae) |>
define_plan(plan = plan(analysis = "ae_forest_plot",
population = "apat",
observation = "apat",
parameter = "any-AE"
)) |>
# ----------------------------------------- #
# define populations
# ----------------------------------------- #
define_population(name = "apat",
group = "TRTA",
subset = SAFFL == "Y" ,
label = "All Participants as Treated Population",
var = c("USUBJID", "TRTA", "RACE", "SEX", "AGE", "AGEU")) |>
# ----------------------------------------- #
# define observations
# ----------------------------------------- #
define_observation(name = "apat",
group = "TRTA",
subset = SAFFL == "Y" ,
label = "All Participants as Treated Population") |>
# ----------------------------------------- #
# define analysis like 1 row in A&R grid
# ----------------------------------------- #
define_analysis(name = "ae_forest_plot",
label = "Interactive AE Forest Plot") |>
# ----------------------------------------- #
# parameters for AE analysis
# ----------------------------------------- #
# Any AEs
define_parameter(name = "any-AE",
subset = SAFFL == "Y",
label = "Any AEs",
var = "AEDECOD", soc = "AEBODSYS", term1 = "", term2 = "") |>
meta_build()
meta |> prepare_ae_forestly(population = "apat", observation = "apat", ae_listing_display = c("USUBJID", "RACE", "SEX", "AEG", "AEGU"))
The root cause is that, "AGEU" is a variable in adsl, while it doesn't exist in adae.
The root cause is that, "AGEU" is a variable in adsl, while it doesn't exist in adae.
After fixing the bug, please also improve the following:
var = ...indefine_populationshould be NULL, where users MUST provides a list of variablesvar = ...indefine_observationshould be NULL, where users MUST provides a list of variables