Package 'tern.rbmi'

Title: Create interface for rbmi and tern
Description: `RBMI` tabulation with `rtables` and `tern` packages.
Authors: Joe Zhu [aut, cre], Jana Stoilova [aut], F. Hoffmann-La Roche AG [cph, fnd]
Maintainer: Joe Zhu <[email protected]>
License: MIT + file LICENSE
Version: 0.1.3.9006
Built: 2024-09-14 09:18:16 UTC
Source: https://github.com/insightsengineering/tern.rbmi

Help Index


Formatted Analysis function which can be further customized by calling rtables::make_afun() on it. It is used as afun in rtables::analyze().

Description

[Experimental]

Usage

a_rbmi_lsmeans(df, .in_ref_col, show_relative = c("reduction", "increase"))

Arguments

df

input dataframe

.in_ref_col

boolean variable, if reference column is specified

show_relative

"reduction" if (control - treatment, default) or "increase" (treatment - control) of relative change from baseline?


Helper function to produce data frame with results of pool for a single visit

Description

[Experimental]

Usage

h_tidy_pool(x)

Arguments

x

(pool) is a list of pooled object from rbmi analysis results. This list includes analysis results, confidence level, hypothesis testing type.

Examples

data("rbmi_test_data")
pool_obj <- rbmi_test_data

h_tidy_pool(pool_obj$pars[1:3])

Example dataset for tern.rbmi package. This is an pool object from the rbmi analysis, see browseVignettes(package = "tern.rbmi")

Description

[Experimental]

Usage

rbmi_test_data

Format

An object of class pool of length 5.


Statistics function which is extracting estimates from a tidied LS means data frame.

Description

[Experimental]

Usage

s_rbmi_lsmeans(df, .in_ref_col, show_relative = c("reduction", "increase"))

Arguments

df

input dataframe

.in_ref_col

boolean variable, if reference column is specified

show_relative

"reduction" if (control - treatment, default) or "increase" (treatment - control) of relative change from baseline?

Examples

library(rtables)
library(dplyr)
library(broom)

data("rbmi_test_data")
pool_obj <- rbmi_test_data
df <- tidy(pool_obj)

s_rbmi_lsmeans(df[1, ], .in_ref_col = TRUE)

s_rbmi_lsmeans(df[2, ], .in_ref_col = FALSE)

Analyze function for tabulating LS means estimates from tidied rbmi pool results.

Description

[Experimental]

Usage

summarize_rbmi(
  lyt,
  ...,
  table_names = "rbmi_summary",
  .stats = NULL,
  .formats = NULL,
  .indent_mods = NULL,
  .labels = NULL
)

Arguments

lyt

(layout)
input layout where analyses will be added to.

...

additional argument.

table_names

(character)
this can be customized in case that the same vars are analyzed multiple times, to avoid warnings from rtables.

.stats

(character)
statistics to select for the table.

.formats

(named character or list)
formats for the statistics.

.indent_mods

(named integer)
indent modifiers for the labels.

.labels

(named character)
labels for the statistics (without indent).

Examples

library(rtables)
library(dplyr)
library(broom)

data("rbmi_test_data")
pool_obj <- rbmi_test_data

df <- tidy(pool_obj)

basic_table() %>%
  split_cols_by("group", ref_group = levels(df$group)[1]) %>%
  split_rows_by("visit", split_label = "Visit", label_pos = "topleft") %>%
  summarize_rbmi() %>%
  build_table(df)

Helper method (for broom::tidy()) to prepare a data frame from an pool rbmi object containing the LS means and contrasts and multiple visits

Description

[Experimental]

Usage

## S3 method for class 'pool'
tidy(x, ...)

Arguments

x

(pool) is a list of pooled object from rbmi analysis results. This list includes analysis results, confidence level, hypothesis testing type.

...

Additional arguments. Not used. Needed to match generic signature only.

Value

A dataframe