Linear Statistical Models The Less Than Full Rank Model: Yao-Ban Chan
Linear Statistical Models The Less Than Full Rank Model: Yao-Ban Chan
Yao-ban Chan
Linear statistical models: The less than full rank model 1/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
y = Xβ + ε
in the knowledge (or assumption) that X , of dimension n × p, is of
full rank, i.e. r (X ) = p.
XTXb = XTy
have a unique solution.
Linear statistical models: The less than full rank model 2/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 3/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
For example:
I A medical researcher compares three different types of pain
relievers for effectiveness in relieving arthritis;
I A botanist studies the effects of four experimental treatments
used to enhance the growth of tomato plants; or
I An engineer investigates the sulfur content in the five major
coal seams in a particular geographic region.
Linear statistical models: The less than full rank model 4/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Let yij be the j th sample taken from the i th population. Then the
model we use is
yij = µ + τi + εij ,
for i = 1, 2, . . . , k and j = 1, 2, . . . , ni , where
I k is the number of populations/treatments;
I ni is the number of samples from the i th population.
Linear statistical models: The less than full rank model 5/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
y11 1 1 0 ... 0 ε11
y12 1 1 0 ... 0 ε12
µ
.. .. .. .. .. τ1
..
. . . . . .
τ2
y21 = 1 0 1 ... 0 + ε21
y22
1 0 1 ... 0
..
ε22
.
.. .. .. .. .. τk
..
. . . . . .
yk ,nk 1 0 0 ... 1 εk ,nk
y = X β + ε
AF FS FCC
34.6 38.8 26.7
35.1 39.0 26.7
35.3 40.1 27.0
Linear statistical models: The less than full rank model 7/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
y = X β + ε
Linear statistical models: The less than full rank model 8/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
However, the problem goes deeper than that: not only can we not
estimate the parameters, but the parameters themselves are not
well defined.
Linear statistical models: The less than full rank model 9/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
µ + τ1 = 36
µ + τ2 = 39
µ + τ3 = 27.
Linear statistical models: The less than full rank model 10/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
One way we can tackle the less than full rank model is to convert
to a full rank model. We can then use all the machinery we have
developed.
yij = µ + τi + εij ,
for i = 1, 2, 3, j = 1, 2, . . . , ni .
µi = µ + τi .
Linear statistical models: The less than full rank model 11/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
yij = µi + εij ,
Linear statistical models: The less than full rank model 12/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
1
n1 0 0 n1 0 0
X T X = 0 n2 0 , (X T X )−1 = 0 1
n2 0
0 0 n3 1
0 0 n3
Pn1 Pn1
i=1 y1i Pi=1 y1i n1
X T y = Pni=1 b = (X T X )−1 X T y = Pni=1
P 2 2
y2i , y2i n2 .
n3 n3
i=1 y3i i=1 y3i n3
Linear statistical models: The less than full rank model 13/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
Linear statistical models: The less than full rank model 14/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
yT y − yT X (X T X )−1 X T y yT y − yT X b
s2 = = .
n −p n −p
Linear statistical models: The less than full rank model 15/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
s2
Pn1
3 ni
Pni=1 y1i n1
1 X X 2 Pn1 Pn2 Pn3
= yij − i=1 y1i i=1 y2i i=1 y3i 2
Pni=1 y2i n2
n − 3 i=1 j =1 3
i=1 3i n3
y
" 3 n 3 ni
!2 #
i
1 XX X 1 X
= yij2 − yij
n − 3 i=1 j =1 i=1
ni j =1
3
" ni ni
!2 #
1 X X 2 1 X
= yij − yij .
n − 3 i=1 j =1 ni j =1
Linear statistical models: The less than full rank model 16/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
This can be written as a ‘pooled’ variance
Linear statistical models: The less than full rank model 17/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
Linear statistical models: The less than full rank model 18/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
Example. Consider the two-way classification model (without
interaction), with two levels of each factor:
yij = µ + τi + βj + εij , i , j = 1, 2.
The design matrix for this model is
1 1 0 1 0
.. .. .. .. ..
. . . . .
1 1 0 0 1
.. .. .. .. ..
. . . . .
X = 1 0 1
.
1 0
.. .. .. .. ..
. . . . .
1 0 1 0 1
.. .. .. .. ..
. . . . .
Linear statistical models: The less than full rank model 19/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Reparametrization
It is obvious that the first column is the sum of the next two
columns, and also the sum of the 4th and 5th columns. Thus
r (X ) = 3.
Linear statistical models: The less than full rank model 20/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Conditional inverses
Definition 6.1
Let A be a n × p matrix. The p × n matrix Ac is called a
conditional inverse for A if and only if
AAc A = A.
Linear statistical models: The less than full rank model 21/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Conditional inverses
Linear statistical models: The less than full rank model 22/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Conditional inverses
We have
2 4 2 01 0 2 4 2
AA1 A = 1 0 −1 1 − 1 0 1 0 −1
4 2
3 1 −2 0 0 0 3 1 −2
2 4 2 1 0 −1
= 1 0 −1 0 1 1
3 1 −2 0 0 0
2 4 2
= 1 0 −1 = A.
3 1 −2
Linear statistical models: The less than full rank model 23/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Conditional inverses
Linear statistical models: The less than full rank model 24/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Theorem 6.2
Let A be a n × p matrix. Then A has a conditional inverse.
Moreover, conditional inverses can be constructed as follows:
1. Find a minor M of A which is nonsingular and of dimension
r (A) × r (A).
2. Replace M in A with (M −1 )T and the other entries with
zeros.
3. Transpose the resulting matrix.
Linear statistical models: The less than full rank model 25/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 26/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Then we have
M −1 0
M A12 M A12
ABA =
0 A21 A22
0 A21 A22
I 0 M A12
= −1
A21 M 0 A21 A22
M A12
= .
A21 A21 M −1 A12
Linear statistical models: The less than full rank model 27/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
This follows because r (A) is the size of M ; we can write all other
columns of A as linear combinations of the first r (A) columns. In
other words, there exists a matrix R such that
A12 M
= R
A22 A21
A12 = MR
R = M −1 A12
A22 = A21 R
= A21 M −1 A12 .
Linear statistical models: The less than full rank model 28/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 29/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Then T 1
1 0 −4 0
(M −1 )T = − = 4
4 −1 2 1 − 12
and T
1
0 4 0 0 1 0
Ac = 1 − 21 0 = 41 − 21 0 .
0 0 0 0 0 0
Linear statistical models: The less than full rank model 30/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 31/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 32/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Proof.
Linear statistical models: The less than full rank model 33/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
> library(MASS)
> A <- matrix(c(2,-6,3,1,6,4,-2,-1,0),3,3)
> det(A)
[1] 89
> A # non-singular
[,1] [,2] [,3]
[1,] 2 1 -2
[2,] -6 6 -1
[3,] 3 4 0
Linear statistical models: The less than full rank model 34/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
Linear statistical models: The less than full rank model 35/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
Linear statistical models: The less than full rank model 36/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
Linear statistical models: The less than full rank model 37/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
Linear statistical models: The less than full rank model 38/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
Linear statistical models: The less than full rank model 39/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
> library(Matrix)
> rankMatrix(A)[1]
[1] 2
> rankMatrix(Ac2 %*% A)[1]
[1] 2
> round(A %*% ginv(t(A) %*% A) %*% t(A) %*% A, 5)
[,1] [,2] [,3]
[1,] 2 1 3
[2,] -6 6 0
[3,] 3 4 7
Linear statistical models: The less than full rank model 40/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
R Example
Linear statistical models: The less than full rank model 41/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
X T X b = X T y.
Theorem 6.3
The
system
Ax = g is consistent if and only if the rank of
A g is equal to the rank of A.
Linear statistical models: The less than full rank model 42/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Proof. (⇐) Since r ( A g ) = r (A), g must be a linear
combination of the columns of A.
x1 a1 + x2 a2 + . . . + xp ap = g
Linear statistical models: The less than full rank model 43/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 44/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Theorem 6.4
In the general linear model y = X β + ε, the normal equations
XTXb = XTy
are consistent.
Linear statistical models: The less than full rank model 45/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
However,
r( X T X X T y ) = r (X T X
y )
≤ r (X T )
= r (X T X ).
Theorem 6.3 now shows that the normal equations are consistent.
Linear statistical models: The less than full rank model 46/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Theorem 6.5
Let Ax = g be a consistent system. Then Ac g is a solution to the
system, where Ac is any conditional inverse for A.
Linear statistical models: The less than full rank model 47/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
b = (X T X )c X T y
Linear statistical models: The less than full rank model 48/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 49/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 50/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
and therefore
1 −1 0 14 8
b = (X T X )c X T y = −1 2 0 6 = −2 .
0 0 0 8 0
Linear statistical models: The less than full rank model 51/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Both these solutions solve the normal equations, and are equally
valid! This is the problem with the less than full rank model.
Linear statistical models: The less than full rank model 52/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
so a conditional inverse is
0 0 0 0
1
0 0 0
(X T X )c =
3 .
0 1
0 3 0
1
0 0 0 3
Linear statistical models: The less than full rank model 53/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
80.4
26.8
Linear statistical models: The less than full rank model 54/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
If the model is less than full rank, the normal equations have an
infinite number of solutions.
Theorem 6.6
Let Ax = g be a consistent system. Then
x = Ac g + (I − Ac A)z
Linear statistical models: The less than full rank model 55/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Ax = A [Ac g + (I − Ac A)z]
= AAc g + (A − AAc A)z
= g + (A − A)z = g.
b = (X T X )c X T y + [I − (X T X )c X T X ]z
Linear statistical models: The less than full rank model 56/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 57/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
b = (X T X )c X T y + [I − (X T X )c X T X ]z
8 1 0 0 1 0 1 z1
= −2 + 0 1 0 − 0 1 −1 z2
0 0 0 1 0 0 0 z3
8 − z3
= −2 + z3
z3
for arbitrary z3 .
7
For example, −1 is a solution.
1
Linear statistical models: The less than full rank model 58/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
The converse of the above theorem is also true: all solutions to the
system can be expressed in this form.
Theorem 6.7
Let Ax = g be a consistent system and let x0 be any solution to
the system. Then for any Ac ,
x0 = Ac g + (I − Ac A)z
where z = x0 .
Linear statistical models: The less than full rank model 59/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Ac g + (I − Ac A)z = Ac g + (I − Ac A)x0
= Ac g + x0 − Ac Ax0
= Ac g + x0 − Ac g = x0 .
For the normal equations, this means that any solution can be
expressed as
b = (X T X )c X T y + [I − (X T X )c X T X ]z
Linear statistical models: The less than full rank model 60/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 61/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Using the theorem, the first solution can be written in terms of the
second solution:
b1 = (X T X )c2 X T y + (I − (X T X )c2 X T X )z
0 1 0 0 0 0 0 2 1 1 8
= 6 + 0 1 0 − 0 1 0 1 1 0 −2
8 0 0 1 0 0 1 1 0 1 0
0 1 0 0 8
= 6 + −1 0 0 −2
8 −1 0 0 0
8
= −2 .
0
Linear statistical models: The less than full rank model 62/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 63/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
● ●
95
● ●
●
90
● ●
maths$maths.y
●
●
85
● ●
●
●
●
80
●
●
● ● ●
75
● ●
maths$class
Linear statistical models: The less than full rank model 64/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
●
80
●
75
1 2 3
Linear statistical models: The less than full rank model 65/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 66/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 68/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Residuals:
Min 1Q Median 3Q Max
-14.40 -1.80 0.85 3.60 10.50
Coefficients:
Estimate Std. Error t value Pr(>|t|)
X[, 2] 79.900 2.053 38.92 <2e-16 ***
X[, 3] 86.500 2.053 42.14 <2e-16 ***
X[, 4] 89.400 2.053 43.55 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear statistical models: The less than full rank model 70/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 72/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 74/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Linear statistical models: The less than full rank model 75/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Definition 6.8
In the general linear model y = X β + ε, a function tT β is said to
be estimable if there exists a vector c such that E [cT y] = tT β.
Linear statistical models: The less than full rank model 76/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Theorem 6.9
In the general linear model y = X β + ε, tT β is estimable if and
only if there is a solution to the linear system X T X z = t.
Then
E [cT y] = E [zT T T T T T T
0 X y] = z0 X E [y] = z0 X X β = t β,
so tT β is estimable.
Linear statistical models: The less than full rank model 77/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Linear statistical models: The less than full rank model 78/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Linear statistical models: The less than full rank model 79/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Theorem 6.10
In the general linear model y = X β + ε, tT β is estimable if and
only if
tT (X T X )c X T X = tT ,
for some (and thus all) conditional inverse of (X T X ).
X T X ((X T X )c )T t = X T X (X T X )c t = t.
Linear statistical models: The less than full rank model 80/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
In other words,
X T X (X T X )c t = t
and by taking transposes, we see that this gives the required
condition.
Linear statistical models: The less than full rank model 81/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Linear statistical models: The less than full rank model 82/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Then
1 −1 0 2 1 1
tT (X T X )c (X T X )
= 0 1 −1 −1 2 0 1 1 0
0 0 0 1 0 1
1 0 1
= 0 1 −1 0 1 −1
0 0 0
T
= 0 1 −1 = t ,
Linear statistical models: The less than full rank model 83/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
T
On the other hand, suppose we take t = 1 0 0 so that
tT β = β0 .
Then we have
1 −1 0 2 1 1
tT (X T X )c (X T X ) =
1 0 0 −1 2 0 1 1 0
0 0 0 1 0 1
1 0 1
= 1 0 0 0 1 −1
0 0 0
T
= 1 0 1 6= t ,
so β0 is not estimable.
Linear statistical models: The less than full rank model 84/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
If both of these are (close to) 0, then the treatments are not
significantly different.
Linear statistical models: The less than full rank model 85/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
We have
3 1 1 1 0 0 0 0
1 1 0 0 1 1 0 0
XTX = 3 (X T X )c X T X =
,
1 0 1 0 1 0 1 0
1 0 0 1 1 0 0 1
0 −1
Linear statistical models: The less than full rank model 86/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
0 0 0 0
1 1 0 0
tT T c T
1 (X X ) X X = 0 1 −1 0
1
= 0 1 −1 0
0 1 0
1 0 0 1
so tT
1 β = τ1 − τ2 is estimable.
0 0 0 0
1 1 0 0
tT T c T
1 (X X ) X X = 0 1 0 −1
1
= 0 1 0 −1
0 1 0
1 0 0 1
so tT
2 β = τ1 − τ3 is also estimable.
Linear statistical models: The less than full rank model 87/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Linear statistical models: The less than full rank model 88/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
E [zT X T y] = zT X T E [y]
= zT X T X β
= tT β.
X T X b = X T y.
Linear statistical models: The less than full rank model 89/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
zT T T T T T T
0 X y = z0 X X b = (X X z0 ) b = t b.
Similarly,
zT T T T T
1 X y = t b = z0 X y.
Linear statistical models: The less than full rank model 90/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Linear statistical models: The less than full rank model 91/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
This estimate is the same as the previous one, which follows from
the theorem: any solution to the normal equation, using any
conditional inverse, will produce exactly the same estimate.
Linear statistical models: The less than full rank model 92/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability
Example. Back to the carbon removal example. We have shown
that τ1 − τ2 and τ1 − τ3 are estimable. We estimate them by
0
35
tT
1 b= 0 1 −1 0 39.3 = −4.3
26.8
and
0
35
tT
2 b= 0 1 0 −1 39.3 = 8.2
26.8
respectively.
Again, no matter what conditional inverse we use, these estimates
remain the same.
Linear statistical models: The less than full rank model 93/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
Theorem 6.12
In the linear model y = X β + ε, elements of X β are estimable.
We have
(X β)i = eT
i Xβ
= eT
i E [y]
= E [eT
i y]
Linear statistical models: The less than full rank model 94/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
1 1 0 0
1 1 0 0
1 1 0 0
µ
1 0 1 0
τ1
X =
1 0 1 0 ,
τ2 .
β=
1 0 1 0
τ3
1 0 0 1
1 0 0 1
1 0 0 1
Linear statistical models: The less than full rank model 95/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
Linear statistical models: The less than full rank model 96/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
Theorem 6.13
Let tT T T
1 β, t2 β, . . . , tk β be estimable functions, and let
z = a1 tT T T
1 β + a2 t2 β + . . . + ak tk β.
a1 tT T T
1 b + a2 t2 b + . . . + ak tk b.
Linear statistical models: The less than full rank model 97/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
Proof. By definition,
z = (a1 t1 + a2 t2 + . . . + ak tk )T β.
(a1 t1 + a2 t2 + . . . + ak tk )T (X T X )c X T X
= a1 tT T c T T T c T T T c T
1 (X X ) X X + a2 t2 (X X ) X X + . . . + ak tk (X X ) X X
= a1 tT T T
1 + a2 t2 . . . + ak tk
= (a1 t1 + a2 t2 + . . . + ak tk )T .
(a1 t1 + a2 t2 + . . . + ak tk )T b.
Linear statistical models: The less than full rank model 98/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
a1 τ1 + a2 τ2 + . . . + ak τk ,
Pk
where i=1 ai = 0.
These treatment contrasts wipe out the effect of the overall mean
response, to describe the differences between populations.
Linear statistical models: The less than full rank model 99/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
If
z = a1 τ1 + a2 τ2 + . . . + ak τk
is a treatment contrast, then
k
X
z = ak µ + a1 τ1 + a2 τ2 + . . . + ak τk
i=1
= a1 (µ + τ1 ) + a2 (µ + τ2 ) + . . . + ak (µ + τk )
Linear statistical models: The less than full rank model 100/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
τi − τj = (µ + τi ) − (µ + τj )
Linear statistical models: The less than full rank model 101/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
Linear statistical models: The less than full rank model 102/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
T c
0 n11 0 0
(X X ) = 1
.
0 0 n2 0
1
0 0 0 n3
Linear statistical models: The less than full rank model 103/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Estimability theorems
Therefore a solution to the normal equations is
0
ȳ1
b = (X T X )c X T y =
ȳ2 .
ȳ3
We have τ1 − τ2 = 0 1 −1 0 β, so the best linear unbiased
estimator for τ1 − τ2 is
0
ȳ1
0 1 −1 0 ȳ2 = ȳ1 − ȳ2 .
ȳ3
> tt %*% b
[,1]
[1,] -6.6
> tt %*% b2
[,1]
[1,] -6.6
> tt %*% b3
[,1]
[1,] -6.6
> mean(maths$maths.y[maths$class.f==1]) -
+ mean(maths$maths.y[maths$class.f==2])
[1] -6.6
Linear statistical models: The less than full rank model 106/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 107/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
For the less than full rank model, R uses contrasts for its tests.
The two main contrast sets are contr.treatment and
contr.sum. For the one-way classification model:
Linear statistical models: The less than full rank model 108/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 109/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Residuals:
Min 1Q Median 3Q Max
-14.40 -1.80 0.85 3.60 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
Residuals:
Min 1Q Median 3Q Max
-14.40 -1.80 0.85 3.60 10.50
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 85.267 1.185 71.943 < 2e-16 ***
class.f1 -5.367 1.676 -3.202 0.00348 **
class.f2 1.233 1.676 0.736 0.46818
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residuals vs Fitted
●
10
●
●
●
●
●
5
●
● ●
●
●
●
Residuals
●
0
●
● ●
●
●
−5
●
●
●
−10
● 20 30 ●
−15
22 ●
80 82 84 86 88
Fitted values
lm(maths.y ~ class.f)
Linear statistical models: The less than full rank model 112/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Normal Q−Q
2
●
●
●
●
●
1
Standardized residuals
●
●
●● ●
●
●
●●●
●●
0
●●●
●
●●
●
−1
●
●
●
20 ●30 ●
−2
● 22
−2 −1 0 1 2
Theoretical Quantiles
lm(maths.y ~ class.f)
Linear statistical models: The less than full rank model 113/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Scale−Location
22 ●
1.5
● 20 30 ●
●
●
●
Standardized residuals
● ●
1.0
●
●
● ●
●
●
0.5
● ●
●
●
●
●
0.0
80 82 84 86 88
Fitted values
lm(maths.y ~ class.f)
Linear statistical models: The less than full rank model 114/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
●
●
●
●
●
1
●
Standardized residuals
●
● ●
●
●
●
●
0
●
● ●
●
●
−1
●
●
●
● 20 30 ●
−2
22 ●
class.f :
1 2 3
Linear statistical models: The less than full rank model 115/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 116/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
For the less than full rank model we can still define the residual
sum of squares as
Linear statistical models: The less than full rank model 117/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Theorem 6.14
SSRes = yT [I − X (X T X )c X T ]y.
Linear statistical models: The less than full rank model 118/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 119/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
E [SSRes ] = r (I − H )σ 2 = (n − r )σ 2 ,
Theorem 6.15
In the general linear model y = X β + ε, suppose X has rank r
and ε has mean 0 and variance σ 2 I . Then an unbiased estimator
for σ 2 is
SSRes
.
n −r
Linear statistical models: The less than full rank model 120/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 122/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
> library(Matrix)
> (SSRes <- sum((y-X%*%b)^2))
[1] 1137.8
> sum(y^2) - t(y) %*% X %*% XtXc %*% t(X) %*% y
[,1]
[1,] 1137.8
> (s2 <- SSRes/(n - rankMatrix(X)[1]))
[1] 42.14074
Linear statistical models: The less than full rank model 123/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
> deviance(model)
[1] 1137.8
> deviance(model)/model$df.residual
[1] 42.14074
Linear statistical models: The less than full rank model 124/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 125/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
The σ 2 term was not known, but cancelled out another σ 2 term in
the numerator to leave us with something that we could calculate.
We can proceed in a similar manner for the less than full rank
model.
Linear statistical models: The less than full rank model 126/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Theorem 6.16
In the general linear model y = X β + ε, assume
ε ∼ MVN (0, σ 2 I ). Then
(n − r )s 2 SSRes
=
σ2 σ2
has a χ2 distribution with n − r degrees of freedom.
Theorem 6.17
In the general linear model y = X β + ε, assume
ε ∼ MVN (0, σ 2 I ). If tT β is estimable, then tT b is independent
of s 2 .
Linear statistical models: The less than full rank model 127/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
The steps to derive a confidence interval are very similar to that for
the full rank case, but with two small differences. Firstly, we can
only find confidence intervals for quantities that are estimable!
Linear statistical models: The less than full rank model 128/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
We have
Var tT b = Var tT (X T X )c X T y
= tT (X T X )c X T σ 2 IX (X T X )c t
= σ 2 tT (X T X )c t.
Thus p
(tT b − tT β)/σ tT (X T X )c t
p
s 2 /σ 2
has a t distribution with n − r degrees of freedom.
Linear statistical models: The less than full rank model 129/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
This formula can also be used to find confidence intervals for the
individual parameters, if they are estimable.
Linear statistical models: The less than full rank model 130/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 131/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
We also had
0 0 0 0
0
0 1
1 0 0
t=
−1 ,
(X T X )c =
0
n1
1
.
0 n2 0
0 1
0 0 0 n3
Linear statistical models: The less than full rank model 132/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
You may have seen this formula before. The linear models
framework has allowed us to derive it from first principles.
Linear statistical models: The less than full rank model 133/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 134/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 135/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
2.5 % 97.5 %
(Intercept) 75.6879592 84.11204
class.f2 0.6432748 12.55673
class.f3 3.5432748 15.45673
Linear statistical models: The less than full rank model 136/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 137/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
Linear statistical models: The less than full rank model 138/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
To find the difference between class 3 and the average of the other
two classes, we need
1 1 1
τ3 − τ2 − τ1 = (τ3 − τ1 ) − (τ2 − τ1 )
2 2 2
1
= class.f3 − class.f2.
2
Linear statistical models: The less than full rank model 139/140
Classification Conditional inverses Normal equations Estimability σ2 Interval estimation
For contr.sum:
1 1 2
class.f1 + class.f2 = τ1 + τ2 − τ3
3 3 3
1 1 3 3
τ3 − τ2 − τ1 = − class.f1 − class.f2
2 2 2 2
Linear statistical models: The less than full rank model 140/140