ae_summary: Comparing Adverse Events (preferred terms) of interest by...

View source: R/02_ae_summary.R

ae_summaryR Documentation

Comparing Adverse Events (preferred terms) of interest by treatment

Description

This function compares different adverse events using multiple visualization methods: Forest plot, Rate plot, Swimmer plot, Volcano Plot for P-values, and Volcano Plots for Adjusted P-values.

Usage

ae_summary(
  adae,
  adsl,
  kind = "forest",
  pval_cutoff = 1,
  adjpval_cutoff = 0.9,
  reord_type_rateplot = "diff",
  title = "",
  subtitle = "",
  caption = ""
)

Arguments

adae

Adverse Event dataset

adsl

Subject Level dataset

kind

The type of visualization. Options are 'forest', 'rate', 'volcano_pval', and 'volcano_adjpval'. Default is 'forest'.

pval_cutoff

A cut-off value for filtering the hazard output results on 'p.value < pval_cutoff'. No effects on the 'rate' and 'swimmer' plots. Default is '1'.

adjpval_cutoff

A cut-off value for showing the text on the 'volcano_pval' and 'volcano_adjpval outputs'. It will apply a filtration on 'adjpvalue < adjpval_cutoff'. No effects on the 'rate' and 'swimmer' plots. Default is '0.9'.

reord_type_rateplot
title

A string shows the main title plot.

subtitle

A string shows the subtitle plot.

caption

A string shows the caption of plot.

Value

A ggplot object

Note

for the 'forest', 'volcano_pval', and 'volcano_adjpval', this function calculates hazard ratio based on the following 'Cox' regression model: coxph(Surv(AVAL, CNSR) ~ TRT01A)

Examples

## Not run: 

 load("data/adsl.rda")
 load("data/adae.rda")

 ae_summary(adae = adae,
            adsl = adsl,
            kind = "forest",
            pval_cutoff = 0.6
           )

 ae_summary(adae = adae,
            adsl = adsl,
            kind = "rate"
           )

 ae_summary(adae = adae,
            adsl = adsl,
            kind = "swimmer"
           )

 ae_summary(adae = adae,
            adsl = adsl,
            kind = "volcano_pval",
            pval_cutoff = 1,
            adjpval_cutoff = 0.9
           )


 ae_summary(adae = adae,
            adsl = adsl,
            kind = "volcano_adjpval",
            pval_cutoff = 1,
            adjpval_cutoff = 0.9
            )

## End(Not run)

DMC21cent/DMC21cent documentation built on May 14, 2023, 5:53 p.m.