bdFactor
with a
contrasts
attribute.
C(object, contr, how.many)
bdFactor
, or an ordered factor.
helmert
,
poly
,
treatment
, or
sum
),
a function, or a matrix with as many rows as there are levels to the factor or
bdFactor
.
The standard names must not be quoted.
The default is the first element of
the
contrasts
option for factors or
bdFactor
s,
and the second element of the option for ordered factors.
bdFactor
.
The default is
k-1
,
where
k
is the number of levels.
bdFactor
, with the contrasts attribute set as above.
This may be used in a model formula or to create a new factor or
bdFactor
.
Note that setting
how.many
to be
less than
k-1
in a model formula
is an assertion that the coefficients for the remaining factors or
bdFactor
s
are either known to be negligible
or else should be aliased with other coefficients.
The
wafer
example
below is an example of aliasing the remaining contrasts.
# Use treatment contrasts for factor Cat: aov(Yield ~ Conc * C(Cat, treatment), catalyst) # Only fit linear and quadratic effects: aov(Defects ~ C(Reliability, poly, 2) * Type * Plant) # Partition spinsp into linear effect (the term with C) and # the higher order contrasts (the term with spinsp). # note that the order of the terms is important aov(pre.mean ~ C(spinsp, poly, 1) + spinsp, data=wafer)