Skip to contents

Format Exposure Duration Analysis

Usage

format_exp_duration(
  outdata,
  display_col = c("n", "prop", "n_cum", "prop_cum", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)

Arguments

outdata

A metadata object created by prepare_sl_summary().

display_col

Column wants to display on the table. "n_cum", "prop_cum" can additionally be selected.

digits_prop

Number of digits for proportion columns.

display_stat

A vector of statistics term name. The term name could be selected from c("mean", "sd", "se", "median", "q1 to q3", "range", "q1", "q3", "min", "max").

Value

A list of analysis raw datasets.

Examples

meta <- metalite::meta_adam(
  population = metalite_sl_adexsum,
  observation = metalite_sl_adexsum
) |>
  metalite::define_plan(metalite::plan(
    analysis = "exp_dur", population = "apat",
    observation = "apat", parameter = "expdur"
  )) |>
  metalite::define_population(
    name = "apat", group = "TRTA", subset = APERIOD == 1 & AVAL > 0
  ) |>
  metalite::define_parameter(
    name = "expdur", subset = PARAMCD == "TRTDURD", var = "AVAL",
    label = "Exposure Duration (Days)", vargroup = "EXDURGR"
  ) |>
  metalite::define_analysis(
    name = "exp_dur", title = "Summary of Exposure Duration",
    label = "exposure duration table"
  ) |>
  metalite::meta_build()

meta |>
  prepare_exp_duration(population = "apat", parameter = "expdur") |>
  format_exp_duration(display_col = c("n", "prop", "total"))
#> List of 18
#>  $ meta           :List of 7
#>  $ population     : chr "apat"
#>  $ observation    : chr "apat"
#>  $ parameter      : chr "expdur"
#>  $ n              :'data.frame':	1 obs. of  6 variables:
#>  $ order          : NULL
#>  $ group          : chr "TRTA"
#>  $ reference_group: NULL
#>  $ char_n         :List of 1
#>  $ char_var       : chr "AVAL"
#>  $ char_prop      :List of 1
#>  $ var_type       :List of 1
#>  $ group_label    : Factor w/ 3 levels "Placebo","Low Dose",..: 1 3 2
#>  $ analysis       : chr "exp_dur"
#>  $ tbl            :'data.frame':	14 obs. of  10 variables:
#>  $ display_col    : chr [1:3] "n" "prop" "total"
#>  $ display_stat   : chr [1:6] "mean" "sd" "se" "median" ...
#>  $ extend_call    :List of 1