ssType3.lm(object) ssType3.aovlist(object) ssType3.formula(formula, data=sys.parent(), ...)
"lm"
or
"aovlist"
.
formula
argument. If
data
is missing, the variables in the formula should be in the search list.
aov
.
"ssType3"
, which is a structure with the following data members:
"anova"
containing the Type III sum of squares for each effect.
gen.form
,
over.par
, and
assign
:
a matrix containing the general form of the estimable functions.
over.par
matrix that correspond to each term in the model.
The sum of squares for each term listed in the ANOVA table is adjusted for all other terms in the model. These sums of squares are independent of the order that the terms are specified in the model formula. If the data are balanced, the sequential sum of squares equals the Type III sum of squares. If the data are unbalanced but complete, then the Type III sums of squares are those obtained from Yates' weighted squares-of-means technique. In this case, the hypotheses tested by the Type III sums of squares for the main effects is that the levels of the unweighted means are equal.
Consider a linear function of the overparameterized model parameters
t(h)%*%b
, where
h
is the
pxd
matrix of hypotheses and
b
is a
px1
vector of the parameter estimates.
This function is estimable if there exists a
qxd
matrix of constants
l
such that
L%*%l = h
.
Here,
L
is the
pxq
matrix containing the general form of the estimable functions found in
est.fun$gen.form
.
The hypotheses tested by the Type III sum of squares,
h
, are contained in
est.fun$over.par
.
The list
est.fun$assign
identifies the columns in
est.fun$over.par
that are associated with each term. The dimension
d
corresponds to the degrees of freedom of each term.
# Create a sample data set. bakers <- data.frame( Fat = factor(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3)), Surfactant = factor(c( 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 3, 3, 3, 3, 1, 1, 2, 2, 2, 2, 3, 3)), Flour = factor(c(1, 2, 3, 1, 3, 4, 2, 3, 4, 2, 3, 4, 2, 4, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 2, 3)), Volume = c(6.7, 4.3, 5.7, 7.1, 5.9, 5.6, 5.5, 6.4, 5.8, 5.9, 7.4, 7.1, 5.6, 6.8, 6.4, 5.1, 6.2, 6.3, 7.1, 5.9, 7.3, 6.6, 8.1, 6.8, 7.5, 9.1)) # Use the formula method. ssType3(Volume ~ Fat*Surfactant + Flour, data = bakers) # Define an aov model and use the lm method. bakers.aov <- aov(Volume ~ Fat*Surfactant + Flour, data = bakers, contrasts = list(Flour = contr.sum(4), Fat = contr.sum(3), Surfactant = contr.sum(3)), na.action = na.exclude) ssType3(bakers.aov)