# Create analysis plan for interactive Kaplan-Meier plots
plan <- plan(
analysis = "km_curvely",
population = "apat",
observation = "wk12",
parameter = "ttde;male")
# Create a metadata representation for ADaM data analysis
adsl <- read_sas('/opt/bardsar/test/baamr/mk9999-p001/dataanalysis/adsl.sas7bdat')
adtte <- read_sas('/opt/bardsar/test/baamr/mk9999-p001/dataanalysis/adtte.sas7bdat')
meta <- meta_adam(observation = adtte, population = adsl) |>
define_plan(plan) |>
# Define population meta information
define_population(
name = "apat",
var = c("USUBJID", "SAFFL", "TRT01A", "SITEID", "SEX", "RACE", "AGE"),
group = "TRT01A",
subset = SAFFL == 'Y',
label = "All Participants as Treated"
) |>
# Define observation meta information
define_observation(
name = "wk12",
var = c("USUBJID", "SAFFL", "TRTA", "PARAMCD", "AVAL", "CNSR"),
group = "TRTA",
subset = SAFFL == 'Y',
label = "Weeks 0 to 12"
) |>
# Define parameter for interactive Kaplan-Meier plots
define_parameter(
name = "ttde",
subset = PARAMCD == "TTDE",
label = "Time to First Dermatologic Event"
) |>
define_parameter(
name = "male",
subset = SEX == "M",
label = "Male"
) |>
# Define analysis meta information for interactive Kaplan-Meier plots.
define_analysis(
name = "km_curvely",
title = "KM Plots of All Participants and Subgroups"
) |>
meta_build()
meta |> kmcurvely(
population = "apat",
observation = "wk12",
endpoint = "ttde",
subgroup = "male",
x_label = "time",
y_label = "Survival rate",
color = c("red", "blue"),
time_unit = "days"
)
The following code gives an error message of
Error in kmcurvely_static(surv_shared = tbl_surv, tbl_at_risk = tbl_at_risk, : object 'title_end' not found