int_spec: Create an interaction specification for fixed parameters

View source: R/priors.R

int_specR Documentation

Create an interaction specification for fixed parameters

Description

Create an interaction specification for fixed parameters

Usage

int_spec(between, value, level = NULL, with_level = NULL)

Arguments

between

Character vector of length 2 specifying the two attributes to interact

value

Numeric. Interaction coefficient value

level

Character. For categorical variables, specific level of first attribute

with_level

Character. For categorical variables, specific level of second attribute

Value

An interaction specification list

Examples

# Continuous * continuous interaction
int_spec(between = c("price", "weight"), value = 0.1)

# Continuous * categorical interactions (must specify categorical level)
int_spec(between = c("price", "type"), with_level = "Fuji", value = 0.15)
int_spec(between = c("price", "type"), with_level = "Gala", value = 0.05)

# Categorical * categorical interactions (must specify both levels)
int_spec(between = c("type", "freshness"),
         level = "Fuji", with_level = "Poor", value = -0.2)

jhelvy/cbcTools documentation built on July 17, 2025, 3:02 a.m.