Package 'tern.rbmi'

Title: Create Interface for 'RBMI' and 'tern'
Description: 'RBMI' implements standard and reference based multiple imputation methods for continuous longitudinal endpoints (Gower-Page et al. (2022) <doi:10.21105/joss.04251>). This package provides an interface for 'RBMI' uses the 'tern' <https://cran.r-project.org/package=tern> framework by Zhu et al. (2023) and tabulate results easily using 'rtables' <https://cran.r-project.org/package=rtables> by Becker et al. (2023).
Authors: Joe Zhu [aut, cre], Jana Stoilova [aut], F. Hoffmann-La Roche AG [cph, fnd]
Maintainer: Joe Zhu <[email protected]>
License: Apache License 2.0
Version: 0.1.4
Built: 2024-11-26 13:58:59 UTC
Source: CRAN

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?

Value

Formatted Analysis function


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.

Value

Data frame with results of pool for a single visit.

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?

Value

A list of statistics extracted from a tidied LS means data frame.

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).

Value

rtables layout for tabulating LS means estimates from tidied rbmi pool results.

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