model_table: Create APA-formatted table of model results

View source: R/model_table.R

model_tableR Documentation

Create APA-formatted table of model results

Description

Generates an APA-formatted HTML table of model estimates that opens in the RStudio Viewer. Provides publication-ready tables with proper formatting for Bayesian model results.

Usage

model_table(
  object,
  selector,
  digits = 3,
  caption = NULL,
  show_chains = TRUE,
  show_neff = FALSE
)

Arguments

object

A blimp_obj containing model results.

selector

Optional character string specifying variable name or block to display. If missing, creates separate tables for each variable.

digits

Integer specifying number of decimal places. Default is 3.

caption

Optional character string for table caption.

show_chains

Logical indicating whether to show chain information. Default is TRUE.

show_neff

Logical indicating whether to show effective sample size. Default is FALSE.

Details

The function creates APA-style tables with the following features:

  • Proper coefficient formatting with confidence intervals

  • Organized sections for different parameter types

  • Publication-ready styling

  • Responsive design for different screen sizes

Tables are displayed in the RStudio Viewer pane and can be exported or copied.

Value

Invisibly returns the HTML content. Primary purpose is displaying in Viewer.

Examples


# Generate Data
mydata <- rblimp_sim(
    c(
        'x ~ normal(0, 1)',
        'y ~ normal(10 + 0.5*x, 1)'
    ),
    n = 100,
    seed = 10972
)

# Fit model
model <- rblimp(
    'y ~ x',
    mydata,
    seed = 10972,
    burn = 1000,
    iter = 1000
)

# Create APA table for all variables
model_table(model)

# Create table for specific variable
model_table(model, "y")

# Customize formatting
model_table(model, digits = 2, caption = "Bayesian Model Results")


rblimp documentation built on May 18, 2026, 9:07 a.m.