Skip to contents

Factor columns assumed +/-1.

Usage

mrm_fractional_factorial(data, response_col, factor_cols, generator = NULL)

Arguments

data

data.frame.

response_col

Response column.

factor_cols

Character vector of factor columns (each coded -1 or +1).

generator

Optional generator string "X=YZ,..." for aliasing.

Value

Named list with main_effects, alias_structure, n, k, interpretation.

Examples

# 2^(3-1) fractional with D = A*B*C generator: 4 runs instead of 8.
set.seed(2026)
lvl <- c(-1, 1)
df <- data.frame(
  A = c(-1, 1, -1, 1),
  B = c(-1, -1, 1, 1),
  C = c(1, -1, -1, 1)
)
df$y <- 5 + 2 * df$A + 1.5 * df$B + rnorm(4, 0, 0.3)
res <- mrm_fractional_factorial(df,
  response_col = "y",
  factor_cols = c("A", "B", "C")
)
res$main_effects
#> $A
#> [1] 3.72636
#> 
#> $B
#> [1] 3.092039
#> 
#> $C
#> [1] 0.206444
#>