Skip to contents

Format Treatment Compliance Analysis

Format Treatment Compliance Analysis

Usage

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

format_trt_compliance(
  outdata,
  display_col = c("n", "prop", "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. The term could be selected from c("n", "prop", "total").

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.

A list of analysis raw datasets.

Examples

meta <- metalite::meta_adam(
  population = metalite_sl_adsl,
  observation = metalite_sl_adsl
) |>
  metalite::define_plan(metalite::plan(
    analysis = "trt_compliance", population = "apat",
    observation = "apat", parameter = "comp8;comp16"
  )) |>
  metalite::define_population(
    name = "apat", group = "TRTA", subset = SAFFL == "Y"
  ) |>
  metalite::define_parameter(
    name = "comp8", var = "COMP8FL", label = "Compliance (Week 8)"
  ) |>
  metalite::define_parameter(
    name = "comp16", var = "COMP16FL", label = "Compliance (Week 16)"
  ) |>
  metalite::define_analysis(
    name = "trt_compliance", title = "Summary of Treatment Compliance"
  ) |>
  metalite::meta_build()
#> Warning: trt_compliance: has missing label

meta |>
  prepare_trt_compliance(parameter = "comp8;comp16") |>
  format_trt_compliance()
#> List of 17
#>  $ meta           :List of 7
#>  $ population     : chr "apat"
#>  $ observation    : chr "apat"
#>  $ parameter      : chr "comp8;comp16"
#>  $ n              :'data.frame':	1 obs. of  6 variables:
#>  $ order          : NULL
#>  $ group          : chr "TRTA"
#>  $ reference_group: NULL
#>  $ char_n         :List of 2
#>  $ char_var       : chr [1:2] "COMP8FL" "COMP16FL"
#>  $ char_prop      :List of 2
#>  $ var_type       :List of 2
#>  $ group_label    : Factor w/ 3 levels "Placebo","Low Dose",..: 1 3 2
#>  $ analysis       : chr "trt_compliance"
#>  $ tbl            :'data.frame':	5 obs. of  10 variables:
#>  $ display_col    : chr [1:3] "n" "prop" "total"
#>  $ display_stat   : chr [1:6] "mean" "sd" "se" "median" ...
meta <- metalite::meta_adam(
  population = metalite_sl_adsl,
  observation = metalite_sl_adsl
) |>
  metalite::define_plan(metalite::plan(
    analysis = "trt_compliance", population = "apat",
    observation = "apat", parameter = "comp8;comp16"
  )) |>
  metalite::define_population(
    name = "apat", group = "TRTA", subset = SAFFL == "Y"
  ) |>
  metalite::define_parameter(
    name = "comp8", var = "COMP8FL", label = "Compliance (Week 8)"
  ) |>
  metalite::define_parameter(
    name = "comp16", var = "COMP16FL", label = "Compliance (Week 16)"
  ) |>
  metalite::define_analysis(
    name = "trt_compliance", title = "Summary of Treatment Compliance"
  ) |>
  metalite::meta_build()
#> Warning: trt_compliance: has missing label

meta |>
  prepare_trt_compliance(population = "apat", parameter = "comp8;comp16") |>
  format_trt_compliance()
#> List of 17
#>  $ meta           :List of 7
#>  $ population     : chr "apat"
#>  $ observation    : chr "apat"
#>  $ parameter      : chr "comp8;comp16"
#>  $ n              :'data.frame':	1 obs. of  6 variables:
#>  $ order          : NULL
#>  $ group          : chr "TRTA"
#>  $ reference_group: NULL
#>  $ char_n         :List of 2
#>  $ char_var       : chr [1:2] "COMP8FL" "COMP16FL"
#>  $ char_prop      :List of 2
#>  $ var_type       :List of 2
#>  $ group_label    : Factor w/ 3 levels "Placebo","Low Dose",..: 1 3 2
#>  $ analysis       : chr "trt_compliance"
#>  $ tbl            :'data.frame':	5 obs. of  10 variables:
#>  $ display_col    : chr [1:3] "n" "prop" "total"
#>  $ display_stat   : chr [1:6] "mean" "sd" "se" "median" ...