Skip to main content

Module formula

Module formula 

Source
Expand description

R-style formula parser and design matrix builder

This module provides formula parsing and evaluation similar to R’s formula interface, supporting:

  • Basic terms: y ~ x1 + x2
  • Interaction terms: y ~ x1:x2, y ~ x1*x2
  • Polynomial terms: y ~ x1^2
  • Factor expansion: y ~ factor(x1)
  • Special functions: y ~ log(x1) + sqrt(x2)
  • Random effects (for mixed models): y ~ (1 | group)

Structs§

Formula
A formula expression (response ~ predictors)

Enums§

Term
A term in a formula (variable, function, or interaction)