Title: | Adverse Events Analysis Using 'metalite' |
---|---|
Description: | Analyzes adverse events in clinical trials using the 'metalite' data structure. The package simplifies the workflow to create production-ready tables, listings, and figures discussed in the adverse events analysis chapters of "R for Clinical Study Reports and Submission" by Zhang et al. (2022) <https://r4csr.org/>. |
Authors: | Yilong Zhang [aut], Yujie Zhao [aut, cre], Benjamin Wang [aut], Nan Xiao [aut], Sarad Nepal [aut], Madhusudhan Ginnaram [aut], Venkatesh Burla [ctb], Ruchitbhai Patel [aut], Brian Lang [aut], Xuan Deng [aut], Hiroaki Fukuda [aut], Bing Liu [aut], Jeetender Chauhan [aut], Li Ma [ctb], Merck Sharp & Dohme Corp [cph] |
Maintainer: | Yujie Zhao <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2024-10-24 04:27:23 UTC |
Source: | CRAN |
Add average duration information for AE specific analysis
extend_ae_specific_duration(outdata, duration_var, duration_unit = "Day")
extend_ae_specific_duration(outdata, duration_var, duration_unit = "Day")
outdata |
An |
duration_var |
A character value of variable name for adverse event duration. |
duration_unit |
A character value of adverse event duration unit. |
A list of analysis raw datasets.
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_duration(duration_var = "ADURN") |> format_ae_specific(display = c("n", "prop", "dur")) head(tbl$tbl)
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_duration(duration_var = "ADURN") |> format_ae_specific(display = c("n", "prop", "dur")) head(tbl$tbl)
Add average number of events information for AE specific analysis
extend_ae_specific_events(outdata)
extend_ae_specific_events(outdata)
outdata |
An |
A list of analysis raw datasets.
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_events() |> format_ae_specific(display = c("n", "prop", "events_avg")) head(tbl$tbl)
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_events() |> format_ae_specific(display = c("n", "prop", "events_avg")) head(tbl$tbl)
Add inference information for AE specific analysis
extend_ae_specific_inference(outdata, ..., ci = 0.95)
extend_ae_specific_inference(outdata, ..., ci = 0.95)
outdata |
An |
... |
Other options passed on to |
ci |
A numeric value for the percentile of confidence interval. |
A list of analysis raw datasets.
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_inference(eps = 1e-6, bisection = 200) |> format_ae_specific(display = c("n", "prop", "diff", "diff_ci")) head(tbl$tbl)
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_inference(eps = 1e-6, bisection = 200) |> format_ae_specific(display = c("n", "prop", "diff", "diff_ci")) head(tbl$tbl)
Add subgroup analysis in AE specific analysis
extend_ae_specific_subgroup(outdata, subgroup_var)
extend_ae_specific_subgroup(outdata, subgroup_var)
outdata |
An |
subgroup_var |
a character string for subgroup variable name |
A list of analysis raw datasets.
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_subgroup(subgroup_var = "SEX")
meta <- meta_ae_example() tbl <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) |> extend_ae_specific_subgroup(subgroup_var = "SEX")
Add exposure-adjusted rate information for AE summary analysis
extend_ae_summary_eaer( outdata, duration_var = "TRTDUR", adj_unit = c("year", "month", "week", "day") )
extend_ae_summary_eaer( outdata, duration_var = "TRTDUR", adj_unit = c("year", "month", "week", "day") )
outdata |
An |
duration_var |
A character value of duration variable name.
By default, |
adj_unit |
A character value of exposure adjusted unit.
It could be select from |
A list of analysis raw datasets.
meta <- meta_ae_example() prepare_ae_summary( meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" ) |> extend_ae_summary_eaer()
meta <- meta_ae_example() prepare_ae_summary( meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" ) |> extend_ae_summary_eaer()
Format confidence interval
fmt_ci(lower, upper, digits = 2, width = 3 + digits)
fmt_ci(lower, upper, digits = 2, width = 3 + digits)
lower |
A numeric value of lower value of CI. |
upper |
A numeric value of upper value of CI. |
digits |
Digits of each column, i.e., format as (x.x, x.x). |
width |
Width of each column. |
A numeric vector with the expected format.
fmt_ci(0.2356, 0.3871)
fmt_ci(0.2356, 0.3871)
Formats mean sd/se to a format as x.x or x.x (x.xx) if both mean and sd/sd are defined.
fmt_est( mean, sd = rep(NA, length(mean)), digits = c(1, 1), width = c(4, 3) + digits )
fmt_est( mean, sd = rep(NA, length(mean)), digits = c(1, 1), width = c(4, 3) + digits )
mean |
A numeric vector of mean value. |
sd |
A numeric vector of standard deviation value. |
digits |
Digits of each column, i.e., format as x.x (x.xx). |
width |
Width of each column. |
The function assumes 1 column or 2 columns:
If there is only 1 column, only represent mean.
If there are 2 columns, represent mean (sd) or mean(se). Decimals will understand the number will be formatted as x.x (x.xx).
The same data frame with additional attributes for page features.
The contents of this section are shown in PDF user manual only.
fmt_est(mean(iris$Petal.Length), sd(iris$Petal.Length)) fmt_est(mean(iris$Petal.Length), sd(iris$Petal.Length), digits = c(2, 3))
fmt_est(mean(iris$Petal.Length), sd(iris$Petal.Length)) fmt_est(mean(iris$Petal.Length), sd(iris$Petal.Length), digits = c(2, 3))
Format percentage
fmt_pct(x, digits = 1, pre = "(", post = ")")
fmt_pct(x, digits = 1, pre = "(", post = ")")
x |
A numeric vector. |
digits |
Number of digits. |
pre |
Text before the number. |
post |
Text after the number. |
A numeric vector with the expected format.
fmt_pct(c(1, 1.52, 0.3, 100))
fmt_pct(c(1, 1.52, 0.3, 100))
Format p-value
fmt_pval(p, digits = 3, width = 3 + digits)
fmt_pval(p, digits = 3, width = 3 + digits)
p |
A numeric vector of p-values. |
digits |
Digits of each column, i.e., format as x.xxx. |
width |
Width of each column. |
A numeric vector with the expected format.
fmt_pval(c(0.1234, 0.00002))
fmt_pval(c(0.1234, 0.00002))
Format exposure-adjusted AE summary
format_ae_exp_adj( outdata, display = c("n", "total_exp", "events", "eaer", "total"), digits_total_exp = 2, digits_eaer = 2, mock = FALSE )
format_ae_exp_adj( outdata, display = c("n", "total_exp", "events", "eaer", "total"), digits_total_exp = 2, digits_eaer = 2, mock = FALSE )
outdata |
An |
display |
A character vector of measurement to be displayed:
|
digits_total_exp |
A numeric value of number of digits for total exposure value. |
digits_eaer |
A numeric value of number of digits for exposure-adjusted event rate. |
mock |
A boolean value to display mock table. |
A list of analysis raw datasets.
meta <- meta_ae_example() outdata <- meta |> prepare_ae_summary( population = "apat", observation = "wk12", parameter = "any;ser;rel" ) |> extend_ae_summary_eaer(adj_unit = "month") tbl <- outdata |> format_ae_exp_adj() head(tbl$tbl)
meta <- meta_ae_example() outdata <- meta |> prepare_ae_summary( population = "apat", observation = "wk12", parameter = "any;ser;rel" ) |> extend_ae_summary_eaer(adj_unit = "month") tbl <- outdata |> format_ae_exp_adj() head(tbl$tbl)
Format AE specific analysis
format_ae_specific( outdata, display = c("n", "prop", "total"), hide_soc_stats = FALSE, digits_prop = 1, digits_ci = 1, digits_p = 3, digits_dur = c(1, 1), digits_events = c(1, 1), filter_method = c("percent", "count"), filter_criteria = 0, sort_order = c("alphabetical", "count_des", "count_asc"), sort_column = NULL, mock = FALSE )
format_ae_specific( outdata, display = c("n", "prop", "total"), hide_soc_stats = FALSE, digits_prop = 1, digits_ci = 1, digits_p = 3, digits_dur = c(1, 1), digits_events = c(1, 1), filter_method = c("percent", "count"), filter_criteria = 0, sort_order = c("alphabetical", "count_des", "count_asc"), sort_column = NULL, mock = FALSE )
outdata |
An |
display |
A character vector of measurement to be displayed:
|
hide_soc_stats |
A boolean value to hide stats for SOC rows. |
digits_prop |
A numeric value of number of digits for proportion value. |
digits_ci |
A numeric value of number of digits for confidence interval. |
digits_p |
A numeric value of number of digits for p-value. |
digits_dur |
A numeric value of number of digits for average duration of adverse event. |
digits_events |
A numeric value of number of digits for average of number of adverse events per subject. |
filter_method |
A character value to specify how to filter rows:
|
filter_criteria |
A numeric value to display rows where at least
one therapy group has a percent incidence or participant count
greater than or equal to the specified value.
If |
sort_order |
A character value to specify sorting order:
|
sort_column |
A character value of |
mock |
A boolean value to display mock table. |
A list of analysis raw datasets.
meta <- meta_ae_example() outdata <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) # Basic example tbl <- outdata |> format_ae_specific() head(tbl$tbl) # Filtering tbl <- outdata |> format_ae_specific( filter_method = "percent", filter_criteria = 10 ) head(tbl$tbl) # Display different measurements tbl <- outdata |> extend_ae_specific_events() |> format_ae_specific(display = c("n", "prop", "events_count")) head(tbl$tbl)
meta <- meta_ae_example() outdata <- prepare_ae_specific(meta, population = "apat", observation = "wk12", parameter = "rel" ) # Basic example tbl <- outdata |> format_ae_specific() head(tbl$tbl) # Filtering tbl <- outdata |> format_ae_specific( filter_method = "percent", filter_criteria = 10 ) head(tbl$tbl) # Display different measurements tbl <- outdata |> extend_ae_specific_events() |> format_ae_specific(display = c("n", "prop", "events_count")) head(tbl$tbl)
Format AE specific subgroup analysis
format_ae_specific_subgroup( outdata, display = c("n", "prop"), digits_prop = 1, digits_ci = 1, digits_p = 3, digits_dur = c(1, 1), digits_events = c(1, 1), mock = FALSE )
format_ae_specific_subgroup( outdata, display = c("n", "prop"), digits_prop = 1, digits_ci = 1, digits_p = 3, digits_dur = c(1, 1), digits_events = c(1, 1), mock = FALSE )
outdata |
An |
display |
A character vector of measurement to be displayed.
|
digits_prop |
A numeric value of number of digits for proportion value. |
digits_ci |
A numeric value of number of digits for confidence interval. |
digits_p |
A numeric value of number of digits for p-value. |
digits_dur |
A numeric value of number of digits for average duration of adverse event. |
digits_events |
A numeric value of number of digits for average of number of adverse event per subjects. |
mock |
Logical. Display mock table or not. |
A list of analysis raw datasets for subgroup analysis.
meta <- meta_ae_example() prepare_ae_specific_subgroup(meta, population = "apat", observation = "wk12", parameter = "rel", subgroup_var = "SEX", display_subgroup_total = TRUE ) |> format_ae_specific_subgroup()
meta <- meta_ae_example() prepare_ae_specific_subgroup(meta, population = "apat", observation = "wk12", parameter = "rel", subgroup_var = "SEX", display_subgroup_total = TRUE ) |> format_ae_specific_subgroup()
Format AE summary analysis
format_ae_summary( outdata, display = c("n", "prop", "total"), hide_soc_stats = FALSE, digits_prop = 1, digits_ci = 1, digits_p = 3, digits_dur = c(1, 1), digits_events = c(1, 1), filter_method = c("percent", "count"), filter_criteria = 0, sort_order = c("alphabetical", "count_des", "count_asc"), sort_column = NULL, mock = FALSE )
format_ae_summary( outdata, display = c("n", "prop", "total"), hide_soc_stats = FALSE, digits_prop = 1, digits_ci = 1, digits_p = 3, digits_dur = c(1, 1), digits_events = c(1, 1), filter_method = c("percent", "count"), filter_criteria = 0, sort_order = c("alphabetical", "count_des", "count_asc"), sort_column = NULL, mock = FALSE )
outdata |
An |
display |
A character vector of measurement to be displayed:
|
hide_soc_stats |
A boolean value to hide stats for SOC rows. |
digits_prop |
A numeric value of number of digits for proportion value. |
digits_ci |
A numeric value of number of digits for confidence interval. |
digits_p |
A numeric value of number of digits for p-value. |
digits_dur |
A numeric value of number of digits for average duration of adverse event. |
digits_events |
A numeric value of number of digits for average of number of adverse events per subject. |
filter_method |
A character value to specify how to filter rows:
|
filter_criteria |
A numeric value to display rows where at least
one therapy group has a percent incidence or participant count
greater than or equal to the specified value.
If |
sort_order |
A character value to specify sorting order:
|
sort_column |
A character value of |
mock |
A boolean value to display mock table. |
A list of analysis raw datasets.
meta <- meta_ae_example() outdata <- prepare_ae_summary(meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" ) tbl <- outdata |> format_ae_summary() head(tbl$tbl)
meta <- meta_ae_example() outdata <- prepare_ae_summary(meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" ) tbl <- outdata |> format_ae_summary() head(tbl$tbl)
meta_adam
objectThis function is only for illustration purpose. r2rtf is required.
meta_ae_example()
meta_ae_example()
A metadata object.
meta <- meta_ae_example()
meta <- meta_ae_example()
A dataset containing exposure details.
metalite_ae_adex
metalite_ae_adex
A data frame with 591 rows and 41 variables.
An analysis data frame.
https://github.com/phuse-org/phuse-scripts/tree/master/data/sdtm/cdiscpilot01
A dataset containing exposure details in Basic Data Structure (BDS).
metalite_ae_adexsum
metalite_ae_adexsum
A data frame with 254 rows and 30 variables.
An analysis data frame.
https://github.com/phuse-org/phuse-scripts/tree/master/data/sdtm/cdiscpilot01
Prepare datasets for AE listing
prepare_ae_listing(meta, analysis, population, observation, parameter)
prepare_ae_listing(meta, analysis, population, observation, parameter)
meta |
A metadata object created by metalite. |
analysis |
Analysis name from |
population |
A character value of population term name. The term name is used as key to link information. |
observation |
A character value of observation term name. The term name is used as key to link information. |
parameter |
A character value of parameter term name. The term name is used as key to link information. |
A list of analysis datasets needed for AE listing.
meta <- meta_ae_example() str(prepare_ae_listing(meta, "ae_listing", "apat", "wk12", "ser"))
meta <- meta_ae_example() str(prepare_ae_listing(meta, "ae_listing", "apat", "wk12", "ser"))
Prepare datasets for AE specific analysis
prepare_ae_specific( meta, population, observation, parameter, components = c("soc", "par"), reference_group = NULL )
prepare_ae_specific( meta, population, observation, parameter, components = c("soc", "par"), reference_group = NULL )
meta |
A metadata object created by metalite. |
population |
A character value of population term name. The term name is used as key to link information. |
observation |
A character value of observation term name. The term name is used as key to link information. |
parameter |
A character value of parameter term name. The term name is used as key to link information. |
components |
A character vector of components name. |
reference_group |
An integer to indicate reference group. Default is 2 if there are 2 groups, otherwise, the default is 1. |
A list of analysis datasets needed for AE specific analysis.
meta <- meta_ae_example() str(prepare_ae_specific(meta, "apat", "wk12", "rel")) # Allow to extract each components prepare_ae_specific(meta, "apat", "wk12", "rel", components = NULL)$data prepare_ae_specific(meta, "apat", "wk12", "rel", components = "soc")$data prepare_ae_specific(meta, "apat", "wk12", "rel", components = "par")$data
meta <- meta_ae_example() str(prepare_ae_specific(meta, "apat", "wk12", "rel")) # Allow to extract each components prepare_ae_specific(meta, "apat", "wk12", "rel", components = NULL)$data prepare_ae_specific(meta, "apat", "wk12", "rel", components = "soc")$data prepare_ae_specific(meta, "apat", "wk12", "rel", components = "par")$data
Prepare datasets for AE specific subgroup analysis
prepare_ae_specific_subgroup( meta, population, observation, parameter, subgroup_var, subgroup_header = c(meta$population[[population]]$group, subgroup_var), components = c("soc", "par"), display_subgroup_total = TRUE )
prepare_ae_specific_subgroup( meta, population, observation, parameter, subgroup_var, subgroup_header = c(meta$population[[population]]$group, subgroup_var), components = c("soc", "par"), display_subgroup_total = TRUE )
meta |
A metadata object created by metalite. |
population |
A character value of population term name. The term name is used as key to link information. |
observation |
A character value of observation term name. The term name is used as key to link information. |
parameter |
A character value of parameter term name. The term name is used as key to link information. |
subgroup_var |
A character value of subgroup variable name in
observation data saved in |
subgroup_header |
A character vector for column header hierarchy. The first element will be the first level header and the second element will be second level header. |
components |
A character vector of components name. |
display_subgroup_total |
Logical. Display total column for subgroup analysis or not. |
A list of analysis datasets needed for AE specific subgroup analysis.
meta <- meta_ae_example() prepare_ae_specific_subgroup(meta, "apat", "wk12", "rel", subgroup_var = "SEX")$data
meta <- meta_ae_example() prepare_ae_specific_subgroup(meta, "apat", "wk12", "rel", subgroup_var = "SEX")$data
Prepare datasets for AE summary
prepare_ae_summary(meta, population, observation, parameter, ...)
prepare_ae_summary(meta, population, observation, parameter, ...)
meta |
A metadata object created by metalite. |
population |
A character value of population term name. The term name is used as key to link information. |
observation |
A character value of observation term name. The term name is used as key to link information. |
parameter |
A character value of parameter term name. The term name is used as key to link information. |
... |
Additional arguments passed to |
A list of analysis datasets needed for AE summary.
meta <- meta_ae_example() prepare_ae_summary( meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" )
meta <- meta_ae_example() prepare_ae_summary( meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" )
Unstratified and stratified Miettinen and Nurminen test details can be found
in vignette("rate-compare")
.
rate_compare( formula, strata, data, delta = 0, weight = c("ss", "equal", "cmh"), test = c("one.sided", "two.sided"), bisection = 100, eps = 1e-06, alpha = 0.05 )
rate_compare( formula, strata, data, delta = 0, weight = c("ss", "equal", "cmh"), test = c("one.sided", "two.sided"), bisection = 100, eps = 1e-06, alpha = 0.05 )
formula |
A symbolic description of the model to be fitted,
which has the form |
strata |
An optional vector of weights to be used in the analysis. If not specified, unstratified MN analysis is used. If specified, stratified MN analysis is conducted. |
data |
An optional data frame, list, or environment containing
the variables in the model.
If not found in data, the variables are taken from |
delta |
A numeric value to set the difference of two group under the null. |
weight |
Weighting schema used in stratified MN method.
Default is
|
test |
A character string specifying the side of p-value,
must be one of |
bisection |
The number of sections in the interval used in bisection method. Default is 100. |
eps |
The level of precision. Default is 1e-06. |
alpha |
Pre-defined alpha level for two-sided confidence interval. |
A data frame with the test results.
Miettinen, O. and Nurminen, M, Comparative Analysis of Two Rates. Statistics in Medicine, 4(2):213–226, 1985.
# Conduct the stratified MN analysis with sample size weights treatment <- c(rep("pbo", 100), rep("exp", 100)) response <- c(rep(0, 80), rep(1, 20), rep(0, 40), rep(1, 60)) stratum <- c(rep(1:4, 12), 1, 3, 3, 1, rep(1:4, 12), rep(1:4, 25)) rate_compare( response ~ factor(treatment, levels = c("pbo", "exp")), strata = stratum, delta = 0, weight = "ss", test = "one.sided", alpha = 0.05 )
# Conduct the stratified MN analysis with sample size weights treatment <- c(rep("pbo", 100), rep("exp", 100)) response <- c(rep(0, 80), rep(1, 20), rep(0, 40), rep(1, 60)) stratum <- c(rep(1:4, 12), 1, 3, 3, 1, rep(1:4, 12), rep(1:4, 25)) rate_compare( response ~ factor(treatment, levels = c("pbo", "exp")), strata = stratum, delta = 0, weight = "ss", test = "one.sided", alpha = 0.05 )
Unstratified and stratified Miettinen and Nurminen test in aggregate data level
rate_compare_sum( n0, n1, x0, x1, strata = NULL, delta = 0, weight = c("ss", "equal", "cmh"), test = c("one.sided", "two.sided"), bisection = 100, eps = 1e-06, alpha = 0.05 )
rate_compare_sum( n0, n1, x0, x1, strata = NULL, delta = 0, weight = c("ss", "equal", "cmh"), test = c("one.sided", "two.sided"), bisection = 100, eps = 1e-06, alpha = 0.05 )
n0 , n1
|
The sample size in the control group and experimental group,
separately. The length should be the same as the length for
|
x0 , x1
|
The number of events in the control group and
experimental group, separately. The length should be the same
as the length for |
strata |
A vector of stratum indication to be used in the analysis.
If |
delta |
A numeric value to set the difference of two groups under the null. |
weight |
Weighting schema used in stratified MN method.
Default is
|
test |
A character string specifying the side of p-value,
must be one of |
bisection |
The number of sections in the interval used in bisection method. Default is 100. |
eps |
The level of precision. Default is 1e-06. |
alpha |
Pre-defined alpha level for two-sided confidence interval. |
A data frame with the test results.
Miettinen, O. and Nurminen, M, Comparative Analysis of Two Rates. Statistics in Medicine, 4(2):213–226, 1985.
# Conduct the stratified MN analysis with sample size weights treatment <- c(rep("pbo", 100), rep("exp", 100)) response <- c(rep(0, 80), rep(1, 20), rep(0, 40), rep(1, 60)) stratum <- c(rep(1:4, 12), 1, 3, 3, 1, rep(1:4, 12), rep(1:4, 25)) n0 <- sapply(split(treatment[treatment == "pbo"], stratum[treatment == "pbo"]), length) n1 <- sapply(split(treatment[treatment == "exp"], stratum[treatment == "exp"]), length) x0 <- sapply(split(response[treatment == "pbo"], stratum[treatment == "pbo"]), sum) x1 <- sapply(split(response[treatment == "exp"], stratum[treatment == "exp"]), sum) strata <- c("a", "b", "c", "d") rate_compare_sum( n0, n1, x0, x1, strata, delta = 0, weight = "ss", test = "one.sided", alpha = 0.05 )
# Conduct the stratified MN analysis with sample size weights treatment <- c(rep("pbo", 100), rep("exp", 100)) response <- c(rep(0, 80), rep(1, 20), rep(0, 40), rep(1, 60)) stratum <- c(rep(1:4, 12), 1, 3, 3, 1, rep(1:4, 12), rep(1:4, 25)) n0 <- sapply(split(treatment[treatment == "pbo"], stratum[treatment == "pbo"]), length) n1 <- sapply(split(treatment[treatment == "exp"], stratum[treatment == "exp"]), length) x0 <- sapply(split(response[treatment == "pbo"], stratum[treatment == "pbo"]), sum) x1 <- sapply(split(response[treatment == "exp"], stratum[treatment == "exp"]), sum) strata <- c("a", "b", "c", "d") rate_compare_sum( n0, n1, x0, x1, strata, delta = 0, weight = "ss", test = "one.sided", alpha = 0.05 )
Exposure-adjusted AE summary table
tlf_ae_exp_adj( outdata, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", title = c("analysis", "observation", "population"), footnotes = NULL, path_outdata = NULL, path_outtable = NULL )
tlf_ae_exp_adj( outdata, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", title = c("analysis", "observation", "population"), footnotes = NULL, path_outdata = NULL, path_outtable = NULL )
outdata |
An |
source |
A character value of the data source. |
col_rel_width |
Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. |
text_font_size |
Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). |
orientation |
Orientation in 'portrait' or 'landscape'. |
title |
Term "analysis", "observation"and "population") for collecting title from metadata or a character vector of table titles. |
footnotes |
A character vector of table footnotes. |
path_outdata |
A character string of the outdata path. |
path_outtable |
A character string of the outtable path. |
RTF file and source dataset for exposure-adjusted AE summary table.
meta <- meta_ae_example() outdata <- meta |> prepare_ae_summary( population = "apat", observation = "wk12", parameter = "any;rel;ser" ) |> extend_ae_summary_eaer(adj_unit = "month") outdata |> format_ae_exp_adj() |> tlf_ae_exp_adj( source = "Source: [CDISCpilot: adam-adsl; adae]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
meta <- meta_ae_example() outdata <- meta |> prepare_ae_summary( population = "apat", observation = "wk12", parameter = "any;rel;ser" ) |> extend_ae_summary_eaer(adj_unit = "month") outdata |> format_ae_exp_adj() |> tlf_ae_exp_adj( source = "Source: [CDISCpilot: adam-adsl; adae]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
Generate AE listing
tlf_ae_listing( outdata, footnotes = NULL, source = NULL, col_rel_width = NULL, text_font_size = 9, orientation = "landscape", path_outdata = NULL, path_outtable = NULL )
tlf_ae_listing( outdata, footnotes = NULL, source = NULL, col_rel_width = NULL, text_font_size = 9, orientation = "landscape", path_outdata = NULL, path_outtable = NULL )
outdata |
An |
footnotes |
A character vector of table footnotes. |
source |
A character value of the data source. |
col_rel_width |
Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. |
text_font_size |
Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). |
orientation |
Orientation in 'portrait' or 'landscape'. |
path_outdata |
A character string of the outdata path. |
path_outtable |
A character string of the outtable path. |
RTF file and the source dataset for AE listing.
library(r2rtf) library(metalite) meta <- meta_ae_example() prepare_ae_listing(meta, "ae_listing", "apat", "wk12", "ser") |> tlf_ae_listing( footnotes = "footnote1", source = "Source: [CDISCpilot: adam-adsl; adae]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
library(r2rtf) library(metalite) meta <- meta_ae_example() prepare_ae_listing(meta, "ae_listing", "apat", "wk12", "ser") |> tlf_ae_listing( footnotes = "footnote1", source = "Source: [CDISCpilot: adam-adsl; adae]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
Specific adverse events table
tlf_ae_specific( outdata, meddra_version, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", footnotes = NULL, title = c("analysis", "observation", "population"), path_outdata = NULL, path_outtable = NULL )
tlf_ae_specific( outdata, meddra_version, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", footnotes = NULL, title = c("analysis", "observation", "population"), path_outdata = NULL, path_outtable = NULL )
outdata |
An |
meddra_version |
A character value of the MedDRA version for this dataset. |
source |
A character value of the data source. |
col_rel_width |
Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. |
text_font_size |
Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). |
orientation |
Orientation in 'portrait' or 'landscape'. |
footnotes |
A character vector of table footnotes. |
title |
Term "analysis", "observation"and "population") for collecting title from metadata or a character vector of table titles. |
path_outdata |
A character string of the outdata path. |
path_outtable |
A character string of the outtable path. |
RTF file and the source dataset for AE specific table.
meta <- meta_ae_example() meta |> prepare_ae_specific( population = "apat", observation = "wk12", parameter = "rel" ) |> format_ae_specific() |> tlf_ae_specific( source = "Source: [CDISCpilot: adam-adsl; adae]", meddra_version = "24.0", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
meta <- meta_ae_example() meta |> prepare_ae_specific( population = "apat", observation = "wk12", parameter = "rel" ) |> format_ae_specific() |> tlf_ae_specific( source = "Source: [CDISCpilot: adam-adsl; adae]", meddra_version = "24.0", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
Specific adverse events table for subgroup analysis
tlf_ae_specific_subgroup( outdata, meddra_version, source, col_rel_width = NULL, text_font_size = 9, orientation = "landscape", footnotes = NULL, title = NULL, path_outdata = NULL, path_outtable = NULL )
tlf_ae_specific_subgroup( outdata, meddra_version, source, col_rel_width = NULL, text_font_size = 9, orientation = "landscape", footnotes = NULL, title = NULL, path_outdata = NULL, path_outtable = NULL )
outdata |
An |
meddra_version |
A character value of the MedDRA version for this dataset. |
source |
A character value of the data source. |
col_rel_width |
Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. |
text_font_size |
Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). |
orientation |
Orientation in 'portrait' or 'landscape'. |
footnotes |
A character vector of table footnotes. |
title |
Term "analysis", "observation"and "population") for collecting title from metadata or a character vector of table titles. |
path_outdata |
A character string of the outdata path. |
path_outtable |
A character string of the outtable path. |
RTF file and the source dataset for AE specific subgroup analysis table.
meta <- meta_ae_example() prepare_ae_specific_subgroup(meta, population = "apat", observation = "wk12", parameter = "rel", subgroup_var = "SEX", display_subgroup_total = TRUE ) |> format_ae_specific_subgroup() |> tlf_ae_specific_subgroup( meddra_version = "24.0", source = "Source: [CDISCpilot: adam-adsl; adae]", path_outtable = tempfile(fileext = ".rtf") )
meta <- meta_ae_example() prepare_ae_specific_subgroup(meta, population = "apat", observation = "wk12", parameter = "rel", subgroup_var = "SEX", display_subgroup_total = TRUE ) |> format_ae_specific_subgroup() |> tlf_ae_specific_subgroup( meddra_version = "24.0", source = "Source: [CDISCpilot: adam-adsl; adae]", path_outtable = tempfile(fileext = ".rtf") )
AE summary table
tlf_ae_summary( outdata, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", title = c("analysis", "observation", "population"), footnotes = NULL, path_outdata = NULL, path_outtable = NULL )
tlf_ae_summary( outdata, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", title = c("analysis", "observation", "population"), footnotes = NULL, path_outdata = NULL, path_outtable = NULL )
outdata |
An |
source |
A character value of the data source. |
col_rel_width |
Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. |
text_font_size |
Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). |
orientation |
Orientation in 'portrait' or 'landscape'. |
title |
Term "analysis", "observation"and "population") for collecting title from metadata or a character vector of table titles. |
footnotes |
A character vector of table footnotes. |
path_outdata |
A character string of the outdata path. |
path_outtable |
A character string of the outtable path. |
RTF file and the source dataset for AE summary table.
meta <- meta_ae_example() outdata <- prepare_ae_summary(meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" ) outdata |> format_ae_summary() |> tlf_ae_summary( source = "Source: [CDISCpilot: adam-adsl; adae]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
meta <- meta_ae_example() outdata <- prepare_ae_summary(meta, population = "apat", observation = "wk12", parameter = "any;rel;ser" ) outdata |> format_ae_summary() |> tlf_ae_summary( source = "Source: [CDISCpilot: adam-adsl; adae]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )