Model Formula Objects

DESCRIPTION:
These are objects of class "formula". This class of objects represents the structural models in all model-fitting functions, and is used also in a number of other functions, particularly for plots.

GENERATION:
These are created by a call to the ~ operator. This is typically done inside a call to a model fitting function, but need not be.

METHODS:
Generic functions that have methods specific to "formula" include: alias, deriv, dput, formula, pairs, plot, print, update.

STRUCTURE:
A formula is a call (i.e., of mode "call") to the ~ operator. Thus, considered as a list it has (generally) three components. The first component is the name ~, the second component is the response, and the third component is the explanatory variables.

It is possible to build a formula without a response, in which case it must be processed before being used in the typical fashion.


DETAILS:
Formulas are their own value; that is, they represent an expression calling the operator ~, but evaluating this expression just returns the expression itself. The purpose of formula objects is to supply the essential information to fit models, produce plots, etc., in a readable form that can be passed around, stored in other objects, and manipulated to determine the terms and response of a model. Names in the formula will eventually be interpreted as objects, often as variables in a data frame. This interpretation, however, only takes place when the related subexpressions have been removed from the formula object.

Operators in formulas have the same precedence as anywhere else in S-PLUS. Operators that are especially significant in formulas are: +, -, *, /, :, ^ and %in%. The functions I and Error are also used, as is . (period).


SEE ALSO:
terms.object .

EXAMPLES:
my.form <- pre.mean ~ spinsp + devtime

aov(my.form, wafer) tree(my.form, wafer)