Академический Документы
Профессиональный Документы
Культура Документы
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
1/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Recap
We consider the less than full rank model:
y = X +
where the errors have mean 0, variance 2 I , and (sometimes)
are assumed to be jointly normally distributed.
In a less than full rank model, r (X ) < p, and this means that
X T X is singular. In turn, this means that not all quantities
associated with the model can be estimated.
The quantities that can be estimated are called estimable.
Linear Statistical Models: inference for the less than full rank model
2/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
3/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Testability
Definition
A hypothesis H0 is testable if there exists a set of estimable
T
T
functions cT
1 , c2 , . . . , cm such that H0 is true if and only if
T
T
cT
1 = c2 = . . . = cm = 0
4/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
5/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
6/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
1
0 1 1
0
C =
, =
2 .
0 0
1 1
3
Now 1 2 is a contrast, so it is known to be estimable. Similarly,
2 3 is estimable. The rows of C are obviously linearly
independent, so H0 is testable.
Linear Statistical Models: inference for the less than full rank model
7/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
We look back at the full rank case. In this case, the hypothesis
H0 : C = 0 is a special case of the general linear hypothesis
C = , with = 0. The F statistic that we would use to test
this is
(C b)T [C (X T X )1 C T ]1 C b/m
,
SSRes /(n p)
which under the null hypothesis has an F distribution with m and
n p degrees of freedom, where m = r (C ).
Linear Statistical Models: inference for the less than full rank model
8/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
SSRes
np
s 2.
variance,
We change this to the estimator, s 2 =
r = r (X )).
Linear Statistical Models: inference for the less than full rank model
SSRes
nr
(where
9/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
10/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Theorem
Let y = X + be a linear model X is n p, r = r (X ) p, and
is a normal random vector with mean 0 and variance 2 I .
Suppose that C = 0 is testable, where C is an m p with rank
m r . Then
(C b)T [C (X T X )c C T ]1 C b
2
has a noncentral 2 distribution with m degrees of freedom and
noncentrality parameter
=
(C )T [C (X T X )c C T ]1 C
.
2 2
Moreover it is independent of s 2 .
Linear Statistical Models: inference for the less than full rank model
11/91
Testability
One-factor model
Two-factor model
Linear Statistical Models: inference for the less than full rank model
Interaction
ANCOVA
12/91
Testability
One-factor model
Two-factor model
Linear Statistical Models: inference for the less than full rank model
Interaction
ANCOVA
13/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
14/91
Testability
One-factor model
Two-factor model
Linear Statistical Models: inference for the less than full rank model
Interaction
ANCOVA
15/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
AF
34.6
35.1
35.3
FS
38.8
39.0
40.1
FCC
26.7
26.7
27.0
Linear Statistical Models: inference for the less than full rank model
16/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
1
0 1 1
0
C =
, =
2 .
0 1
0 1
3
We have previously calculated
0 0
0 31
(X T X )c =
0 0
0 0
0
0
1
3
Linear Statistical Models: inference for the less than full rank model
0
0
35
0
,b =
39.3
0
1
26.8
3
17/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Therefore
C (X T X )c C T
0 1 1
0
0 1
0 1
0 1 1
0
0 1
0 1
2
3
1
3
1
3
2
3
0
0
0
1
1
0 1
3
0
0 31 0 1
0 1
0 0 13
0
0
1
1
3
13
0
3
0 13
0
0
0
0
0
0
Linear Statistical Models: inference for the less than full rank model
18/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
and
2 1
[C (X X ) C ]
=
1
2
4.3
Cb =
8.2
T
T
c T 1
4.3 8.2
(C b) [C (X X ) C ] C b =
T
T 1
2 1
1
2
4.3
8.2
= 241.98.
Linear Statistical Models: inference for the less than full rank model
19/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
As the critical value for this distribution at the 0.01 level is 9.55,
we can reject H0 quite firmly! Thus the populations are not all the
same. It still is possible that some of the populations are the same,
but not all of them.
Linear Statistical Models: inference for the less than full rank model
20/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
One-factor model
In a one-factor model (one-way classification), if we look closer at
our F statistic, we can see that we do not need all of the individual
data to test certain hypotheses. This is because we have simplified
formulas for various quantities.
In particular, we can write X T X as
n n1
n1 n1
X T X = n2 0
..
..
.
.
nk
0
Linear Statistical Models: inference for the less than full rank model
n2 . . . nk
0 ... 0
n2
0
..
..
.
.
0 . . . nk
21/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
0 0 ... 0
0 1
0
n1
T
c
(X X ) = ..
.. .
.
.
.
.
.
0
0 ...
1
nk
Also we have
P
y
Pij ij
y
Pj 1j
T
X y=
j y2j
..
.
P
y
j kj
Linear Statistical Models: inference for the less than full rank model
22/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
b = (X X ) X y =
0
y1
y2
..
.
yk
Linear Statistical Models: inference for the less than full rank model
23/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Surface
Mean
Number
Clay
6.2
20
Grass
6.8
22
Composition
6.4
24
Wood
5
21
Asphalt
4.4
25
Linear Statistical Models: inference for the less than full rank model
24/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
1
3
1
3
1
3
Linear Statistical Models: inference for the less than full rank model
12
12
25/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Now
Cb =
(X T X )c
= 1.77
0
0
0
=
0
0
0
1
3
1
3
0
1
20
0
0
0
0
1
3
0
0
1
22
0
0
0
Linear Statistical Models: inference for the less than full rank model
21
0
0
0
1
24
0
0
12
0
0
0
0
1
21
0
0
0
0
0
0
6.2
6.8
6.4
5
4.4
1
25
26/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
27/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Example
75
80
85
90
95
100
Linear Statistical Models: inference for the less than full rank model
3
28/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
H0 : 1 = 2 = 3
Linear Statistical Models: inference for the less than full rank model
29/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
> (SS <- t(C %*% b) %*% solve(C %*% XtXc %*% t(C)) %*% C %*% b)
[,1]
[1,] 474.0667
> s2
[1] 42.14074
> (Fstat <- (SS/2)/s2)
[,1]
[1,] 5.624802
> pf(Fstat, 2, n-r, lower.tail=FALSE)
[,1]
[1,] 0.009077098
Linear Statistical Models: inference for the less than full rank model
30/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
3Q
3.60
Max
10.50
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
79.900
2.053 38.922 < 2e-16 ***
class.f2
6.600
2.903
2.273 0.03117 *
class.f3
9.500
2.903
3.272 0.00292 **
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.492 on 27 degrees of freedom
Multiple R-squared: 0.2941, Adjusted R-squared: 0.2418
F-statistic: 5.625 on 2 and 27 DF, p-value: 0.009077
Linear Statistical Models: inference for the less than full rank model
31/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
> anova(model)
Analysis of Variance Table
Response: maths.y
Df Sum Sq Mean Sq F value
Pr(>F)
class.f
2 474.07 237.033 5.6248 0.009077 **
Residuals 27 1137.80 42.141
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 '
Linear Statistical Models: inference for the less than full rank model
32/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
33/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
H0 : 21 = 2 + 3
> C <- matrix(c(0,2,-1,-1),1,4)
> SS <- t(C %*% b) %*% solve(C %*% XtXc %*% t(C)) %*% C %*% b
> SS
[,1]
[1,] 432.0167
> Fstat <- (SS/1)/s2
> Fstat
[,1]
[1,] 10.25176
> pf(Fstat, 1, n-r, lower.tail=FALSE)
[,1]
[1,] 0.00348348
Linear Statistical Models: inference for the less than full rank model
34/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Two-factor models
In this section, we look at two-factor models (two-way
classification), but the ideas can be easily implemented for any
number of factors.
In a basic two-factor model, we assume that each level of each
factor affects the overall mean by a fixed amount. If we name
these effects i for the i th level of factor 1 and j for the j th level
of factor 2, then our model is
yijk = +i +j +ijk ,
i = 1, . . . , a, j = 1, . . . , b, k = 1, . . . , nij .
35/91
Testability
One-factor model
X =
1 1 0
1 1 0
.. .. ..
. . .
1 1 0
1 0 1
1 0 1
.. .. ..
. . .
Two-factor model
... 0 1 0 ...
... 0 0 1
.. ..
..
.
. .
... 0 0 0 ...
... 0 1 0 ...
... 0 0 1
.. ..
..
.
. .
Interaction
0
0
..
.
1
0
0
..
.
1 0 1 ... 0 0 0 ... 1
..
.
1 0 0 ... 1 1 0 ... 0
1 0 0 ... 1 0 1
0
.. .. ..
.. ..
.
..
. ..
. . .
. .
1 0 0 ... 1 0 0 ... 1
Linear Statistical Models: inference for the less than full rank model
ANCOVA
..
, = a
..
36/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Theorem
In an additive two-factor model, every contrast in the s is
estimable. Similarly, every contrast in the s is estimable.
Proof:
Linear Statistical Models: inference for the less than full rank model
37/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
38/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Capsule
type
A
B
Fluid type
Gastric Duodenal
39.5
31.2
47.4
44
Linear Statistical Models: inference for the less than full rank model
39/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
39.5
1 1
47.4
1 1
y=
31.2 , X = 1 0
44
1 0
0
0
1
1
1
0
1
0
1
, =
1
2
1
2
Linear Statistical Models: inference for the less than full rank model
40/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
0 1 1 0 0
= 0.
Linear Statistical Models: inference for the less than full rank model
41/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Interaction
Interaction happens when the level of one factor affects the effect
of the levels of another factor.
Linear Statistical Models: inference for the less than full rank model
42/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Temperature
1
2
1
4
8
Pressure
2 3 4
6 4 3
2 7 5
Linear Statistical Models: inference for the less than full rank model
43/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
44/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Temperature
1
2
1
4
8
Pressure
2 3 4
6 4 3
10 8 7
Linear Statistical Models: inference for the less than full rank model
45/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
46/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
1 1
1 1
X =
1 0
1 0
0
0
1
1
1
0
1
0
0
1
0
1
1
0
0
0
0
1
0
0
Linear Statistical Models: inference for the less than full rank model
0 0
0 0
, =
1 0
0 1
1
2
1
2
11
12
21
22
47/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
48/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Factor II
1
2
Factor I
1
2
6
5
6
5
Linear Statistical Models: inference for the less than full rank model
49/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
i , j .
Linear Statistical Models: inference for the less than full rank model
50/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Example
Consider a two-way classification where each factor has two levels,
with one observation of each combination of levels. We have
(X T X )c
(X T X )c X T X
1 1 0 1 0
1 1 0 0 1
1 0 1 1 0
1 0 1 0 1
055 054
045
I4
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
1 1 0 1 0
1 1 0 0 1
1 0 1 1 0
1 0 1 0 1
Linear Statistical Models: inference for the less than full rank model
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
51/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
0 0 0 0 0 1 1
0
0
0 1
0 .
C = 0 0 0 0 0 1
0 0 0 0 0 1
0
0 1
This hypothesis is not testable since
0 0
0 1 1 1 1
0
0
0 1
0 1
0 =
C (X T X )c X T X = 0 1 1 0
6 C.
0 0 1 1 1 1
0
0 1
Linear Statistical Models: inference for the less than full rank model
52/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Theorem
For the linear model
yijk = + i + j + ij + ijk ,
there is no interaction if and only if
(ij ij 0 ) (i 0 j i 0 j 0 ) = 0
for all i 6= i 0 , j 6= j 0 .
Moreover these quantities are all estimable.
Linear Statistical Models: inference for the less than full rank model
53/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
54/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
+i +j +ij i j 0 ij 0 = +i 0 +j +i 0 j i 0 j 0 i 0 j 0
which reduces to
(ij ij 0 ) (i 0 j i 0 j 0 ) = 0.
In order for there to be no interaction at all, we need this condition
to hold for all i , i 0 , j , j 0 .
Note that the group means ij are all elements of X , and are
thus estimable.
Linear Statistical Models: inference for the less than full rank model
55/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
56/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
0 0 0 0 0 1 1 1 1
=
2 .
11
12
21
22
Linear Statistical Models: inference for the less than full rank model
57/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Interaction considerations
Linear Statistical Models: inference for the less than full rank model
58/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
This follows from the same reasoning as using SSRes for the full
model in sequential tests: we cannot be sure that there is no
interaction, we just havent found any!
However, for practical purposes, this may take away too many
degrees of freedom from SSRes . So if you find no interaction, its
OK to use the SSRes from an additive model.
Linear Statistical Models: inference for the less than full rank model
59/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
60/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Example
We look at the effect of pre-chamber volume ratio and injection
timing on the emission of noxious gas from an engine. The factors
have 3 levels each.
> str(engine)
61/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
9.0
7.0
7.5
8.0
high
medium
low
6.0
6.5
mean of gas
8.5
volume
short
medium
long
time
Linear Statistical Models: inference for the less than full rank model
62/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
9.0
7.0
7.5
8.0
long
medium
short
6.0
6.5
mean of gas
8.5
time
low
medium
high
volume
Linear Statistical Models: inference for the less than full rank model
63/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Label
Intercept
f2
f3
g2
g3
Estimated quantity
11 = + 1 + 1
21 11 = 2 1
31 11 = 3 1
12 11 = 2 1
13 11 = 3 1
Linear Statistical Models: inference for the less than full rank model
64/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Median
0.03583
3Q
0.21375
Max
0.49500
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
6.0533
0.2109 28.703 3.83e-13 ***
timemedium
0.3917
0.2310
1.695 0.113817
timelong
1.1583
0.2310
5.014 0.000237 ***
volumemedium
1.5533
0.2310
6.724 1.42e-05 ***
volumehigh
1.8017
0.2310
7.798 2.95e-06 ***
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4002 on 13 degrees of freedom
Multiple R-squared: 0.8823, Adjusted R-squared: 0.8461
F-statistic: 24.37 on 4 and 13 DF, p-value: 6.136e-06
Linear Statistical Models: inference for the less than full rank model
65/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
66/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
67/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
68/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Interaction
Consider the interaction model
yijk = + i + j + ij + ijk .
Let ij = i + j + ij , then R estimates the following:
Intercept
11 = + 1 + 1 + 11
f2
21 11 = 2 1 + 21 11
f3
31 11 = 3 1 + 31 11
g2
12 11 = 2 1 + 12 11
g3
13 11 = 3 1 + 13 11
f2:g2
22 21 12 + 11 = 22 21 12 + 11
f3:g2
32 31 12 + 11 = 32 31 12 + 11
f2:g3
23 21 13 + 11 = 23 21 13 + 11
f3:g3
33 31 13 + 11 = 33 31 13 + 11
Note how testing f2:g2 = f3:g2 = f2:g3 = f3:g3 = 0 is the test for
no interaction terms.
Linear Statistical Models: inference for the less than full rank model
69/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
3Q
0.13
Max
0.42
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
5.8500
0.1967 29.745 2.68e-10 ***
timemedium
0.8750
0.2781
3.146 0.011815 *
timelong
1.2850
0.2781
4.620 0.001254 **
volumemedium
2.2100
0.2781
7.946 2.34e-05 ***
volumehigh
1.7550
0.2781
6.310 0.000139 ***
timemedium:volumemedium -1.4350
0.3933 -3.648 0.005333 **
timelong:volumemedium
-0.5350
0.3933 -1.360 0.206882
timemedium:volumehigh
-0.0150
0.3933 -0.038 0.970413
timelong:volumehigh
0.1550
0.3933
0.394 0.702715
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Linear Statistical Models: inference for the less than full rank model
70/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
> anova(imodel)
Analysis of Variance Table
Response: gas
Df Sum Sq Mean Sq F value
Pr(>F)
time
2 4.1658 2.0829 26.9246 0.0001591
volume
2 11.4410 5.7205 73.9456 2.594e-06
time:volume 4 1.3853 0.3463 4.4768 0.0289181
Residuals
9 0.6963 0.0774
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05
Linear Statistical Models: inference for the less than full rank model
***
***
*
71/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
72/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
ANCOVA
Linear Statistical Models: inference for the less than full rank model
73/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
A model without interaction assumes that the slopes are the same
(but the intercepts may be different):
yij = + i + xij + ij .
We fit these models using our results for the less than full rank
case.
Linear Statistical Models: inference for the less than full rank model
74/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
75/91
One-factor model
Two-factor model
100
Testability
Interaction
ANCOVA
95
32
2
3
90
85
3
3
23
2
1
1
2
1
1
2
321
75
80
maths$maths.y
1
1
1
90
100
110
120
maths$iq
Linear Statistical Models: inference for the less than full rank model
76/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Median
0.9807
3Q
2.4711
Max
6.3765
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 52.7577
21.9941
2.399
0.0246 *
class.f2
-30.9642
25.7058 -1.205
0.2401
class.f3
-24.0093
25.8357 -0.929
0.3620
iq
0.2701
0.2185
1.236
0.2284
class.f2:iq
0.3474
0.2524
1.376
0.1815
class.f3:iq
0.2729
0.2497
1.093
0.2852
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.043 on 24 degrees of freedom
Multiple R-squared: 0.7566, Adjusted R-squared: 0.7059
Linear Statistical
Models: inference
for the
full rank
F-statistic:
14.92
onless5than
and
24 model
DF, p-value: 1.072e-06
77/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
78/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
> summary(amodel)
Call:
lm(formula = maths.y ~ class.f + iq, data = maths)
Residuals:
Min
1Q Median
-8.137 -2.842 1.220
3Q
2.662
Max
6.393
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 26.02809
8.23338
3.161 0.00396 **
class.f2
4.29503
1.83799
2.337 0.02743 *
class.f3
3.49636
2.01959
1.731 0.09526 .
iq
0.53604
0.08093
6.623 5.03e-07 ***
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.036 on 26 degrees of freedom
Multiple R-squared: 0.7373, Adjusted R-squared: 0.707
F-statistic: 24.33 on 3 and 26 DF, p-value: 1.032e-07
Linear Statistical Models: inference for the less than full rank model
79/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
80/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
81/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
100
95
32
2
3
90
85
3
3
23
2
1
1
2
1
1
2
321
75
80
maths$maths.y
1
1
1
90
100
110
120
maths$iq
Linear Statistical Models: inference for the less than full rank model
82/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
[1,]
[2,]
[3,]
[4,]
[5,]
[6,]
[7,]
Linear Statistical Models: inference for the less than full rank model
83/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
[1,]
Linear Statistical Models: inference for the less than full rank model
84/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
85/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
86/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
87/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
X <- X[,1:5]
XtX <- t(X) %*% X
XtXc <- matrix(0, 5, 5)
XtXc[2:5,2:5] <- solve(XtX[2:5,2:5])
[,1]
[,2] [,3] [,4] [,5]
0 -5.551115e-17
0
0
1
Linear Statistical Models: inference for the less than full rank model
88/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
89/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Linear Statistical Models: inference for the less than full rank model
90/91
Testability
One-factor model
Two-factor model
Interaction
ANCOVA
Test significance of iq
> C <- matrix(c(0,0,0,0,1), 1, 5, byrow=T)
> (Fstat <- t(b) %*% t(C) %*% solve( C %*% XtXc %*% t(C) ) %*%
+
C %*% b / 1 / s2)
[,1]
[1,] 43.86618
Linear Statistical Models: inference for the less than full rank model
91/91