Learn R Programming

rbmiUtils (version 0.3.0)

print.pool: Print Method for Pool Objects

Description

Displays a formatted summary of a pooled analysis object from rbmi::pool(). Uses cli formatting to show rounded estimates, confidence intervals, parameter labels, method information, number of imputations, and confidence level.

Usage

# S3 method for pool
print(x, digits = 2, ...)

Value

Invisibly returns the original pool object x (for pipe chaining).

Arguments

x

An object of class pool, typically obtained from rbmi::pool().

digits

Integer. Number of decimal places for rounding estimates, standard errors, and confidence interval bounds. Default is 2.

...

Additional arguments (currently unused).

Details

This method overrides rbmi::print.pool() to provide enhanced, formatted console output using the cli package. The override produces a "Registered S3 method overwritten" message at package load time, which is expected and harmless (same pattern as print.analysis()).

The output includes:

  • A header with parameter and visit counts

  • Metadata: pooling method, number of imputations, confidence level

  • A compact results table with key columns: parameter, visit, est, lci, uci, pval

See Also

  • tidy_pool_obj() for full tidy tibble output

  • summary.pool() for visit-level breakdown with significance flags

  • rbmi::pool() to create pool objects

Examples

Run this code
# \donttest{
library(rbmi)
library(rbmiUtils)
data("ADMI")

ADMI$TRT <- factor(ADMI$TRT, levels = c("Placebo", "Drug A"))
ADMI$USUBJID <- factor(ADMI$USUBJID)
ADMI$AVISIT <- factor(ADMI$AVISIT)

vars <- set_vars(
  subjid = "USUBJID", visit = "AVISIT", group = "TRT",
  outcome = "CHG", covariates = c("BASE", "STRATA", "REGION")
)
method <- method_bayes(n_samples = 20, control = control_bayes(warmup = 20))

ana_obj <- analyse_mi_data(ADMI, vars, method, fun = ancova)
pool_obj <- pool(ana_obj)
print(pool_obj)
# }

Run the code above in your browser using DataLab