Learn R Programming

cbcTools (version 0.7.1)

cbc_inspect: Comprehensive design quality inspection

Description

This function provides detailed inspection of choice experiment designs across multiple dimensions including design structure, efficiency metrics, attribute balance, overlap patterns, and variable encoding.

Usage

cbc_inspect(design, sections = "all", verbose = FALSE)

Value

A cbc_inspection object containing the inspection results

Arguments

design

A cbc_design or cbc_choices object created by cbc_design()

sections

Character vector specifying which sections to show. Options: "structure", "efficiency", "balance", "overlap", "encoding", or "all" (default). Can specify multiple: c("balance", "overlap")

verbose

Logical. If TRUE, shows additional technical details. If FALSE (default), shows simplified output.

Examples

Run this code
library(cbcTools)

# Create profiles and design
profiles <- cbc_profiles(
  price = c(1, 2, 3),
  type = c("A", "B", "C"),
  quality = c("Low", "High")
)

design <- cbc_design(
  profiles = profiles,
  n_alts = 2,
  n_q = 4
)

# Inspect all sections (default) - prints automatically
cbc_inspect(design)

# Store results for later use
inspection <- cbc_inspect(design, sections = "balance")
inspection  # prints the same output

# Verbose output with technical details
cbc_inspect(design, verbose = TRUE)

Run the code above in your browser using DataLab