TITLE(formula @@ Model Formulae)
USAGE(
y ~ model
formula(object)
formula.default(anything)
formula.formula(formula.obj)
formula.terms(terms.obj)
)
ALIAS(~)
ALIAS(formula.default)
ALIAS(formula.formula)
ALIAS(formula.terms)
ALIAS(print.formula)
DESCRIPTION(
The models fit by the LANG(lm) and LANG(glm) functions
are specified in a compact symbolic form.
The LANG(~) operator is basic in the formation of such models.
An expression of the form LANG(y~model) is interpreted
as a specification that the response LANG(y) is modelled
by a linear predictor specified symbolically by LANG(model).
Such a model consists of a series of terms separated
by LANG(+) operators.
The terms themselves consist of variable and factor
names separated by LANG(:) operators.
Such a term is interpreted as the interaction of
all the variables and factors appearing in the term.
PARA
In addition to LANG(+) and LANG(:), a number of other
operators are useful in model formulae.
The LANG(*) operator denotes factor crossing:
LANG(a*b) interpreted as LANG(a+b+a:b).
The LANG(^) operator indicates crossing to the
specified degree.  For example LANG((a+b+c)^2)
is identical to LANG((a+b+c)*(a+b+c)) which in turn
expands to a formula containing the main effects
for LANG(a), LANG(b) and LANG(c) together
with their second-order interactions.
The LANG(%in%) operator indicates that the terms
on its left are nested within those on the right.
For example LANG(a+b%in%a) expands to the
formula LANG(a+a:b).
PARA
While formulae usually involve just variable and factor 
names, they can also involve arithmetic expressions.
The formula LANG(log(y)~a+log(x)) is quite legal.
When such arithmetic expressions involve
operators which are also used symbolically
in model formulae, there can be confusion between
arithmetic and symbolic operator use.
To avoid this confusion, the function LANG(I())
can be used to bracket those portions of a model
formula where the operators are used in their
arithmetic sense.  For example, in the formula
LANG(y~a+I(b+c)), the term LANG(b+c) is to be
interpreted as the sum of LANG(b) and LANG(c).
PARA
The generic function LANG(formula) and its specific
methods provide a way of extracting formulae
which have been included in other objects.
)
VALUE(
All the functions above produce an object
of class LANG(formula) which contains a symbolic model formula.
)
SEEALSO(
LANG(LINK(lm)), LANG(LINK(glm)), LANG(LINK(terms)).
)
