Skip to content

changed Formula to FormulaTerm in documentation and docstrings, fixes #321 #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/contrasts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/contrasts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/formula.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading