diff --git a/docs/src/contrasts.md b/docs/src/contrasts.md index bea29ba5..2ca9e55b 100644 --- a/docs/src/contrasts.md +++ b/docs/src/contrasts.md @@ -63,7 +63,7 @@ ContrastsCoding ## Further details -### Categorical variables in `Formula`s +### Categorical variables in `FormulaTerm`s Generating model matrices from multiple variables, some of which are categorical, requires special care. The reason for this is that rank-$k-1$ @@ -93,7 +93,7 @@ categorical `a`, `b`, and `c`: * The `a` in `a&b` is *non-redundant* because it aliases `b`, which is not present anywhere else in the formula. -When constructing a `ModelFrame` from a `Formula`, each term is checked for +When constructing a `ModelFrame` from a `FormulaTerm`, each term is checked for non-redundant categorical variables. Any such non-redundant variables are "promoted" to full rank in that term by using [`FullDummyCoding`](@ref) instead of the contrasts used elsewhere for that variable. diff --git a/src/contrasts.jl b/src/contrasts.jl index 02c78de3..a61c0381 100644 --- a/src/contrasts.jl +++ b/src/contrasts.jl @@ -263,7 +263,7 @@ Not exported but included here for the sake of completeness. Needed internally for some situations where a categorical variable with ``k`` levels needs to be converted into ``k`` model matrix columns instead of the standard ``k-1``. This occurs when there are missing lower-order terms, as in -discussed below in [Categorical variables in Formulas](@ref). +discussed below in [Categorical variables in FormulaTerms](@ref). # Examples diff --git a/src/formula.jl b/src/formula.jl index 97003eb0..12dd8f64 100644 --- a/src/formula.jl +++ b/src/formula.jl @@ -23,7 +23,7 @@ catch_dollar(ex::Expr) = """ @formula(ex) -Capture and parse a formula expression as a `Formula` struct. +Capture and parse a formula expression as a `FormulaTerm` struct. A formula is an abstract specification of a dependence between _left-hand_ and _right-hand_ side variables as in, e.g., a regression model. Each side @@ -32,7 +32,7 @@ matrix suitable for modeling. This specification looks something like Julia code, is represented as a Julia `Expr`, but uses special syntax. The `@formula` macro takes an expression like `y ~ 1 + a*b`, transforms it according to the formula syntax rules into a lowered form (like `y ~ 1 + a + b + a&b`), and -constructs a `Formula` struct which captures the original expression, the +constructs a `FormulaTerm` struct which captures the original expression, the lowered expression, and the left- and right-hand-side. Operators that have special interpretations in this syntax are