Skip to contents

Pre-process data for tornado plot

Usage

process_tornado_data(
  dataset_adsl,
  dataset_analysis,
  adsl_subset = NA_character_,
  analysis_subset = NA_character_,
  obs_residual = NA_real_,
  ae_filter = "Any Event",
  pop_fil = NA_character_,
  fmq_data = NULL,
  split_by = NA_character_,
  ae_catvar,
  trtvar,
  trt_left,
  trt_right,
  trtsort = NA_character_,
  subset = NA_character_,
  pctdisp = "TRT",
  denom_subset = NA_character_,
  legendbign = "N",
  yvar = "AESOC"
)

Arguments

dataset_adsl

(data.frame) ADSL dataset.

dataset_analysis

(data.frame) ADAE dataset.

adsl_subset

(string) Subset condition to be applied on dataset_adsl.

analysis_subset

Subset conditions for dataset_analysis

obs_residual

If not NA, use this argument to pass a period (numeric) to extend the observation period. If passed as NA, overall study duration is considered for analysis. eg. if 5, only events occurring upto 5 days past the TRTEDT are considered.

ae_filter

Vector of adverse event types to be used as filter conditions. Permissible Values: "ANY", "ANY EVENT", "TREATMENT EMERGENT", "SERIOUS", "DRUG-RELATED", "RELATED", "MILD", "MODERATE", "SEVERE", "RECOVERED/RESOLVED", "RECOVERING/RESOLVING", "NOT RECOVERING/NOT RESOLVING", "FATAL", "GRADE N"

pop_fil

Population Filter for data set: Name of flag variable. eg: "SAFFL", "EFFFL" or NA for Overall Population.

fmq_data

FMQ table dataframe, if passed, will be merged to adae date by PT.

split_by

(string) By variable for stratification.

ae_catvar

Categorical variable for severity analysis and order variable. eg; "ASEV/ASEVN"

trtvar

(string) Treatment Variable to be created for analysis.

trt_left

A Treatment value for displaying left hand side plot.

trt_right

A Treatment value for displaying right hand side plot.

trtsort

(string) Variable to sort treatment variable by.

subset

Overall subset for data set. eg: "EFFFL == 'Y'" eg: "SAFFL", "EFFFL" or NA for Overall Population.

pctdisp

Method to calculate denominator (for %) by Possible values: "TRT","VAR","COL","SUBGRP","CAT","NONE","NO","DPTVAR"

denom_subset

Subset condition to be applied to data set for calculating denominator.

legendbign

(string) Display BIGN in Legend (Y/N).

yvar

Categorical Analysis variable for Y axis

Value

mcatstat dataset as data frame.

Details

  • ae_catvar grouping variable for severity like AESEV(MILD, MODERATE, SEVERE). It must be passed "/" separated with its numeric variable. eg: ASEV/ASEVN; ATOXGR/ATOXGRN

  • yvar(dptvar) Adverse Event category, derived term from AE. Possible Values: AEBODSYS, AEDECOD, AEHLT, AEHLGT.

Examples

data(tornado_plot_data)
#> Warning: data set ‘tornado_plot_data’ not found

process_tornado_data(
  dataset_adsl = adsl,
  dataset_analysis = adae,
  adsl_subset = "SAFFL == 'Y'",
  analysis_subset = "TRTEMFL == 'Y'",
  obs_residual = "30",
  fmq_data = NA,
  ae_catvar = "AESEV/AESEVN",
  trtvar = "ARM",
  trt_left = "Xanomeline High Dose",
  trt_right = "Xanomeline Low Dose",
  pctdisp = "TRT",
  denom_subset = NA_character_,
  legendbign = "N",
  yvar = "AESOC"
)
#> mcatstat success
#> # A tibble: 159 × 23
#>    BYVAR1 BYVAR2 DPTVAR DPTVAL CVALUE DENOMN  FREQ DPTVALN BYVAR1N BYVAR2N   PCT
#>    <fct>  <chr>  <chr>  <chr>  <chr>   <int> <int>   <dbl>   <dbl>   <dbl> <dbl>
#>  1 MILD   1      AESOC  CARDI… 8 (12…     65     8       1       1       1 12.3 
#>  2 MILD   1      AESOC  EAR A… 1 ( 1…     65     1       3       1       1  1.54
#>  3 MILD   1      AESOC  EYE D… 1 ( 1…     65     1       4       1       1  1.54
#>  4 MILD   1      AESOC  GASTR… 15 (2…     65    15       5       1       1 23.1 
#>  5 MILD   1      AESOC  GENER… 16 (2…     65    16       6       1       1 24.6 
#>  6 MILD   1      AESOC  INFEC… 11 (1…     65    11       9       1       1 16.9 
#>  7 MILD   1      AESOC  INJUR… 3 ( 4…     65     3      10       1       1  4.62
#>  8 MILD   1      AESOC  INVES… 7 (10…     65     7      11       1       1 10.8 
#>  9 MILD   1      AESOC  METAB… 4 ( 6…     65     4      12       1       1  6.15
#> 10 MILD   1      AESOC  MUSCU… 3 ( 4…     65     3      13       1       1  4.62
#> # ℹ 149 more rows
#> # ℹ 12 more variables: CPCT <chr>, XVAR <fct>, DPTVARN <dbl>, CN <chr>,
#> #   Placebo <dbl>, `Xanomeline High Dose` <dbl>, `Xanomeline Low Dose` <dbl>,
#> #   trt_left <dbl>, trt_right <dbl>, splitN <int>, TRTVAR <chr>, TRTTXT <chr>