Subject-Level Analysis Using 'metalite'

Analyzes subject-level data in clinical trials using the 'metalite' data structure. The package simplifies the workflow to create production-ready tables, listings, and figures discussed in the subject-level analysis chapters of "R for Clinical Study Reports and Submission" by Zhang et al. (2022) < https://r4csr.org/>.


metalite.sl

Codecov test coverage R-CMD-check

Overview

R package designed for the analysis & reporting of subject baseline characteristics in clinical trials. We assume ADaM datasets are ready for analysis and leverage metalite data structure to define inputs and outputs.

Workflow

The general workflow is:

  1. Define metadata information using metalite.
  2. prepare_sl_summary() prepares datasets for summary of baseline characteristics.
  3. format_base_char() formats output layout.
  4. rtf_base_char() creates TLFs.

Here is a quick example

library("metalite.sl")

metadata_sl <- metalite::meta_adam(
  population = metalite_sl_adsl,
  observation = metalite_sl_adsl
) |>
  metalite::define_plan(metalite::plan(
    analysis = "base_char",
    population = "apat",
    observation = "apat",
    parameter = "age;gender"
  )) |>
  metalite::define_population(
    name = "apat",
    group = "TRTA",
    subset = SAFFL == "Y"
  ) |>
  metalite::define_parameter(
    name = "age",
    var = "AGE",
    label = "Age (years)",
    vargroup = "AGEGR1"
  ) |>
  metalite::define_parameter(
    name = "gender",
    var = "SEX",
    label = "Gender"
  ) |>
  metalite::define_analysis(
    name = "base_char",
    title = "Participant Baseline Characteristics by Treatment Group"
  ) |>
  metalite::meta_build()

metadata_sl |>
  prepare_sl_summary(
    population = "apat",
    analysis = "base_char",
    parameter = "age;gender"
  ) |>
  format_base_char() |>
  rtf_base_char(
    source = "Source: [CDISCpilot: adam-adsl]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )

Highlighted features

  • Avoid duplicated input by using metadata structure.
    • For example, define analysis population once to use in all adverse events analysis.
  • Consistent input and output in standard functions.
  • Streamlines mock table generation.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("metalite.sl")

0.1.3 by Yujie Zhao, 2 months ago


https://merck.github.io/metalite.sl/, https://github.com/Merck/metalite.sl


Browse source code at https://github.com/cran/metalite.sl


Authors: Yujie Zhao [aut, cre] , Benjamin Wang [aut] , Hiroaki Fukuda [aut] , PoYao Niu [aut] , Nan Xiao [aut] , Jeetener Chauhan [ctb] , Li Ma [ctb] , Chen Wang [ctb] , Merck Sharp & Dohme Corp [cph]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports glue, metalite, metalite.ae, r2rtf, reactable, stringr, rlang, plotly, htmltools, brew, uuid, htmlwidgets

Suggests dplyr, knitr, testthat, tidyr


See at CRAN