Giter Club home page Giter Club logo

gtreg's Introduction

gtreg

R-CMD-check Codecov test coverage CRAN status Lifecycle: experimental

Installation

You can install the development version of {gtreg} from GitHub with:

# install.packages("devtools")
devtools::install_github("shannonpileggi/gtreg")

Overview

The {gtreg} package creates tabular data summaries appropriate for regulatory submissions. The package builds the tables using {gtsummary}.

Functions for adverse event (AE) reporting

Summarize Raw Adverse Counts

tbl_ae_count() provides counts of all AEs, and omits percentage statistics as multiple AEs can occur per subject.

library(gtreg)
tbl_ae_count <- 
  df_adverse_events |> 
  tbl_ae_count(
    ae = adverse_event,
    soc = system_organ_class, 
    by = drug_attribution
  ) |>
  add_overall(across = "by") |>
  modify_spanning_header(all_ae_cols() ~ "**Drug Attribution**") |>
  bold_labels()

Summarize Adverse Events by Grade

tbl_ae() counts one AE per subject by maximum grade; percentage statistics are provided by default with the denominators reflecting the number of patients in the study.

library(gtreg)
gtsummary::theme_gtsummary_compact()
#> Setting theme `Compact`

tbl_ae <- 
  df_adverse_events |>
  tbl_ae(
    id_df = df_patient_characteristics,
    id = patient_id,
    ae = adverse_event,
    soc = system_organ_class, 
    by = grade, 
    strata = trt
  ) |>
  modify_header(all_ae_cols() ~ "**Grade {by}**") |> 
  bold_labels()

Focus on rates of high grade complications

tbl_ae_focus() also counts one AE per subject by maximum grade, and is a convenience to summarize dichotomous AE attributes.

tbl_ae_focus <- 
  df_adverse_events |>
  tbl_ae_focus(
    id_df = df_patient_characteristics,
    id = patient_id,
    ae = adverse_event,
    include = c(any_complication, grade3_complication)
  )

Other Functions for Clinical Reporting

Regulatory summary

tbl_reg_summary() creates a data summary table often seen in regulatory submissions.

tbl_reg_summary <-
  df_patient_characteristics |>
  tbl_reg_summary(by = trt, include = c(marker, status)) 

Print an AE listing

tbl_listing() creates a gtsummary-class listing of data to enable grouped printing.

tbl_listing <-
  head(df_adverse_events, n = 10) |>
  select(system_organ_class, adverse_event, grade, drug_attribution, patient_id) |>
  dplyr::arrange(adverse_event, desc(grade)) |>
  tbl_listing(group_by = system_organ_class) |>
  bold_labels()

Code of Conduct

Please note that the gtreg project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

gtreg's People

Contributors

ddsjoberg avatar shannonpileggi avatar jerryekohe avatar tgerke avatar ksirohi7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.