terms
represent
the information about a structural model, as specified by a formula.
A
terms
object is essentially a digested form of a formula that
can be used by the model fitting functions.
These objects are generated by the
terms
function.
Generic functions that have methods for
"terms"
objects include:
formula
,
labels
.
The object itself is of mode
"expression"
, with one element for each of
the terms, after expansion and possible simplification, and not including
the intercept.
The object also has a number of attributes:
"expression"
, whose elements include those in the
terms.object
itself, as well as the response variable.
term.labels
, to permit cross-referencing.
variables
attribute of the
terms
object, and says which of the variables were among
the specials.
(See the
"Error"
component in the example below.)
These objects drive all the model-fitting and are returned as a component
of the fitted object by the fitting functions
lm
, etc.
terms(Y~Temp*Conc+Error(blocks), specials="Error") # Produces the following output: expression(Temp, Conc, Error(blocks), Temp:Conc) attr(, "formula"): Yield ~ Temp * Conc + Error(blocks) attr(, "factors"): [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 1 0 0 1 [3,] 0 1 0 1 [4,] 0 0 1 0 attr(, "order"): [1] 1 1 1 2 attr(, "variables"): expression(Yield, Temp, Conc, Error(blocks)) attr(, "term.labels"): [1] "Temp" "Conc" "Error(blocks)" "Temp:Conc" attr(, "intercept"): [1] 1 attr(, "response"): [1] 1 attr(, "specials"): attr(, "specials")$Error: [1] 4 attr(, "class"): [1] "terms"