Docsity

Discriminant Analysis: Calculation of Discriminant Functions and Classification, Study notes of Mathematical Statistics

Toggle sidebar
bg1
1
DISCRIMINANT
No analysis is done for any subfile group for which the number of non-empty
groups is less than 2 or the number of cases or sum of weights fails to exceed the
number of non-empty groups. An analysis may be stopped if no variables are
selected during variable selection or the eigenanalysis fails.
Notation
The following notation is used throughout this chapter unless otherwise stated:
g Number of groups
p Number of variables
q Number of variables selected
X
ijk Value of variable i for case k in group j
f
jk Case weights for case k in group j
m
j Number of cases in group j
n
j Sum of case weights in group j
n Total sum of weights
Basic Statistics
Mean
XfXn ij
XfXn
i
ij jk ijk
k
m
j
ijkijk
k
m
j
g
j
j
=F
H
G
G
I
K
J
J
=F
H
G
G
I
K
J
J
=
โ€ข
==
โˆ‘
โˆ‘โˆ‘
1
11
variable in group
variable
bg
af
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Discriminant Analysis: Calculation of Discriminant Functions and Classification and more Study notes Mathematical Statistics in PDF only on Docsity!

1

No analysis is done for any subfile group for which the number of non-empty groups is less than 2 or the number of cases or sum of weights fails to exceed the number of non-empty groups. An analysis may be stopped if no variables are selected during variable selection or the eigenanalysis fails.

Notation

The following notation is used throughout this chapter unless otherwise stated:

g Number of groups p Number of variables q Number of variables selected Xijk Value of variable i for case k in group j f (^) jk Case weights for case k in group j mj Number of cases in group j nj Sum of case weights in group j

n Total sum of weights

Basic Statistics

Mean

X f X n i j

X f X n

i

ij jk ijk k

m j

i jk ijk k

m

j

g

j

j

F

H

G G

I

K

J J

F

H

G G

I

K

J J

=

  • = =

โˆ‘

โˆ‘โˆ‘

1

1 1

variable in group

variable

b g

a f

Variances

S

f X n X

n

i j

S

f X nX

n

i

ij

jk ijk k

m j ij

j

i

jk ijk k

m i j

g

j

j

2

2

1

2

2

2

1

2

1

F

H

G G

I

K

J J

โˆ’

F

H

G G

I

K

J J

โˆ’

=

= =

โˆ‘

โˆ‘โˆ‘

d i

b g

a f

a f

variable in group

variable

Within-groups Sums of Squares and Cross-product Matrix ( W )

w (^) il f (^) jk X (^) ijk X (^) ljk f X f X n i l p k

m

j

g jk ijk k

m jk ljk k

m j j

j g j j = โˆ’

F

H

G G

I

K

J J

F

H

G G

I

K

J J

= = = = =

โˆ‘ โˆ‘ โˆ‘ โˆ‘ โˆ‘ 1 1 1 1 1

Total Sums of Squares and Cross-product Matrix ( T )

t (^) il f (^) jk X (^) ijk X (^) ljk f X f X n k

m

j

g jk ijk k

m

j

g jk ljk k

m

j

j j g j = โˆ’

F

H

G G

I

K

J J

F

H

G G

I

K

J J = = = = = =

โˆ‘ โˆ‘ โˆ‘ โˆ‘ โˆ‘โˆ‘ 1 1 1 1 1 1

Within-groups Covariance Matrix

C
W

n g

n g a f

Rules of Variable Selection

Both direct and stepwise variable entry are possible. Multiple inclusion levels may also be specified.

Method = Direct

For direct variable selection, variables are considered for inclusion in the order in which they are written on the ANALYSIS = list. A variable is included in the analysis if, when it is included, no variable in the analysis will have a tolerance less than the specified tolerance limit (default = 0.001).

Stepwise Variable Selection

At each step, the following rules control variable selection:

  • Eligible variables with higher inclusion levels are entered before eligible variables with lower inclusion levels.
  • The order of entry of eligible variables with the same even inclusion level is determined by their order on the ANALYSIS = specification.
  • The order of entry of eligible variables with the same odd level of inclusion is determined by their value on the entry criterion. The variable with the โ€œbestโ€ value for the criterion statistic is entered first.
  • When level-one processing is reached, prior to inclusion of any eligible variables, all already-entered variables which have level one inclusion numbers are examined for removal. A variable is considered eligible for removal if its F -to-remove is less than the F value for variable removal, or, if probability criteria are used, the significance of its F -to-remove exceeds the specified probability level. If more than one variable is eligible for removal, that variable is removed that leaves the โ€œbestโ€ value for the criterion statistic for the remaining variables. Variable removal continues until no more variables are eligible for removal. Sequential entry of variables then proceeds as described previously, except that after each step, variables with inclusion numbers of one are also considered for exclusion as described before.
  • A variable with a zero inclusion level is never entered, although some statistics for it are printed.

Ineligibility for Inclusion

A variable with an odd inclusion number is considered ineligible for inclusion if:

  • The tolerance of any variable in the analysis (including its own) drops below the specified tolerance limit if it is entered, or
  • Its F -to-enter is less than the F -value for a variable to enter value, or
  • If probability criteria are used, the significance level associated with its F - to-enter exceeds the probability to enter.

A variable with an even inclusion number is ineligible for inclusion if the first condition above is met.

Computations During Variable Selection

During variable selection, the matrix W is replaced at each step by a new matrix W โˆ—^ using the symmetric sweep operator described by Dempster (1969). If the first q variables have been included in the analysis, W may be partitioned as:

W W
W W

11 12 21 22

L N M

O Q P

where W 11 is q ร— q. At this stage, the matrix W โˆ—^ is defined by

W
W W W
W W W W W W
W W
W W

โˆ— โˆ’ โˆ’ โˆ’ โˆ’

โˆ— โˆ— = (^) โˆ— โˆ—

L

N

M M

O

Q

P P

L

N

M M

O

Q

P P

11

1 11

1 12 21 11

1 22 21 11

1 12

11 12 21 22

In addition, when stepwise variable selection is used, T is replaced by the matrix T โˆ—^ , defined similarly.

The Approximate F Test for Lambda (the โ€œoverall F โ€), also known as Raoโ€™s R (Tatsuoka, 1971)

F

r s qh qh

s = (^) s

e jb^ g

where

s

q h q h

q h

r n q g h g

R

S

||

T

| | = โˆ’ โˆ’ + = โˆ’

2 2 2 2

if

otherwise a (^) f

with degrees of freedom qh and r s + 1 โˆ’ qh 2. The approximation is exact if q or h is 1 or 2.

Raoโ€™s V (Lawley-Hotelling trace) (Rao, 1952; Morrison, 1976)

V n g w (^) il t (^) il wil l

q

i

q = โˆ’ โˆ’ โˆ— โˆ’ = =

a fโˆ‘ (^) โˆ‘ b g 1 1

When n โˆ’ g is large, V , under the null hypothesis, is approximately distributed as ฯ‡ 2 with q g a โˆ’ 1 f degrees of freedom. When an additional variable is entered, the

change in V , if positive, has approximately a ฯ‡ 2 distribution with g โˆ’ 1 degrees of

freedom.

The Squared Mahalanobis Distance (Morrison, 1976) between groups a and b

Dab n g w (^) il X (^) ia X (^) ib X (^) la Xlb l

q

i

q 2

1 1

= =

a fโˆ‘ (^) โˆ‘ c hc h

The F value for Testing the Equality of Means of Groups a and b

F

n q g n n q n g n n ab a^ bD a b

= (^) ab

b 1 g^2 b gb g

The Sum of Unexplained Variations (Dixon, 1973)

R Dab b a

g

a

g = + = = +

โˆ’ โˆ‘ โˆ‘^4

2 1 1

1 e j

Classification Functions

Once a set of q variables has been selected, the classification functions (also known as Fisherโ€™s linear discriminant functions) can be computed using

b (^) ij n g w Xil lj i q j g l

q = โˆ’ โˆ— = = =

a f โˆ‘ 1

for the coefficients, and

a (^) j p (^) j b Xij ij j q i

q = โˆ’ = =

log (^) โˆ‘ , , ,

1

for the constant, where pj is the prior probability of group j.

Canonical Discriminant Functions

The canonical discriminant function coefficients are determined by solving the general eigenvalue problem

( T โˆ’ W V ) =ฮป WV

Wilksโ€™ Lambda

Testing the significance of all the discriminating functions after the first k :

ฮ› k i i k

m = + k = m โˆ’ = +

โˆ1 1^ 0 1^1 1

b ฮปg , ,^ โ€ฆ,

The significance level is based on

ฯ‡ 2 = โˆ’ (^) c n โˆ’ a q + g (^) f 2 โˆ’ (^1) hln ฮ› (^) k ,

which is distributed as a ฯ‡ 2 with (^) a q โˆ’ k (^) fa g โˆ’ k โˆ’ (^1) f degrees of freedom.

The Standardized Canonical Discriminant Coefficient Matrix D

The standard canonical discriminant coefficient matrix D is computed as

D = S 11 โˆ’^1 V

where S (^) = diag w w w e 11 ,^22 ,^ โ€ฆ, pp j S 11 = partition containing the first q rows and columns of S V = matrix of eigenvectors such that V W โ€ฒ 11 V = I

The Correlations Between the Canonical Discriminant Functions and the

Discriminating Variables

The correlations between the canonical discriminant functions and the discriminating variables are given by

R = S โˆ’ 1111 W^11 V

If some variables were not selected for inclusion in the analysis (^) a q < p f, the eigenvectors are implicitly extended with zeroes to include the nonselected variables in the correlation matrix. Variables for which Wii = 0 are excluded from S and W for this calculation; p then represents the number of variables with non-zero within-groups variance.

The Unstandardized Coefficients

The unstandardized coefficients are calculated from the standardized ones using

B = a n โˆ’ g f S โˆ’ 111 D

The associated constants are:

a (^) k bik Xi i

q = โˆ’ (^) โ€ข =

โˆ‘ 1

The group centroids are the canonical discriminant functions evaluated at the group means:

f (^) kj a (^) k b (^) ik Xij i

q = + =

โˆ‘ 1

Tests For Equality Of Variance

Boxโ€™s M is used to test for equality of the group covariance matrices.

M n g n (^) j j j

g = โˆ’ โ€ฒ โˆ’ โˆ’ =

a f (^) โˆ‘d i

log C 1 log C a f

1

where

e n n g

p p g p

e n n g

p p g

t g p p

t t e e

b

t e t t

e e

t e t

e e

j j

g

j j

g

1 1

2

(^2 ) 1

2

1

2 1 2 1

2

1 1 1 2

2 1

2

2 1 2

2 1

2

F

H

G G

I

K

J J

F

H

G G

I

K

J J

R

S

||

T

| |

=

=

โˆ‘

โˆ‘

a fa f

a fa f a f

a f a f

b g

if

if

If e 1^2 โˆ’ e 2 is zero, or much smaller than e (^) 2 , t 2 cannot be computed or cannot be

computed accurately. If

e (^) 2 = e (^) 2 + 0 0001. (^) e e (^) 2 โˆ’ e 12 j

the program uses Bartlettโ€™s ฯ‡ 2 statistic rather than the F statistic:

ฯ‡ 2 = M (^) b 1 โˆ’ e 1 g

with t 1 degrees of freedom.

For testing the group covariance matrix of the canonical discriminant functions, the

procedure is similar. The covariance matrices C a f j^ and C โ€ฒ are replaced by D j and

D โ€ฒ, where

D j = B C โ€ฒ a f j B

is the group covariance matrix of the discriminant functions. The pooled covariance matrix in this case is an identity, so that

D โ€ฒ = n โˆ’ g I (^) m โˆ’ (^) โˆ‘ nj โˆ’ D j j

a f (^) d 1 i

where the summation is only over groups with singular D (^) j.

Classification

The basic procedure for classifying a case is as follows:

  • If X is the 1ร— q vector of discriminating variables for the case, the 1ร— m vector of canonical discriminant function values is f = XB + a
  • A chi-square distance from each centroid is computed
ฯ‡ 2 j^ = โˆ’ j j^1 โˆ’ j

d^ f^ f^ i D^ d f^ f i

where D (^) j is the covariance matrix of canonical discriminant functions for group j and f j is the group centroid vector. If the case is a member of group j ,

ฯ‡ 2 j^ has a ฯ‡ 2 distribution with m degrees of freedom. P ( X G ) is the
significance level of such a ฯ‡ 2 j^.
  • The classification, or posterior probability P ( G (^) j | X ), is
P

P e

P e

j

j j

j j j

g

j

j

( G | X )
D
D

โˆ’ (^) โˆ’

โˆ’ (^) โˆ’

=

โˆ‘

1 2 (^2)

1 2 (^2)

1

2

2

ฯ‡

ฯ‡

where pj is the prior probability for group j. A case is classified into the group for which P ( G (^) j | X ) is highest.

Cross-Validation

The following notation is used in this section:

X ~ (^) jk ( X , , X ) jk qjk

T 1 โ€ฆ

M ~ (^) j Sample mean of jth group

M

n j f^ X j

jk jk k

m (^) j

~ = ~

โˆ‘

1 M ~ (^) jk Sample mean of j th group excluding point (^) X ~ (^) jk

M

n f jk f^ X j jk

jl jl l l k

m (^) j

~ =^ โˆ’ ~

โ‰ 

โˆ‘

1

ฮฃ (^) Polled sample covariance matrix ฮฃ (^) j Sample covariance matrix of j th group ฮฃ (^) jk Polled sample covariance matrix without point X ~ (^) jk

ฮฃ โˆ’ jk^1 = โˆ’^ โˆ’ โˆ’

โˆ’

โˆ’ โˆ’

โˆ’

n g f n g n X M X M

n f n g n X M X M

jk

j j jk j jk j

T j

j jk j j jk j

T j jk j

~ ~^ ~ ~

~ ~ ~ ~

1

1 1

1

d (^) 02 ( , a b ~ ~ ) = ( (^) ~ a โˆ’ (^) ~ b ) T^ ฮฃ โˆ’ jk^1 ( (^) ~ a โˆ’ b ~) T

Cross-validation applies only to linear discriminant analysis (not quadratic). During

cross-validation, SPSS loops over all cases in the data set. Each case, say (^) X ~ (^) jk , is

extracted once and treated as test data. The remaining cases are treated as a new

data set.

Here we compute d (^) 02 ( X ~ (^) jk , M ~ jk )and d (^) 02 ( X ~ (^) jk , M ~ i )( i = 1 , ..., g. i โ‰  j ). If there is

an i ( i โ‰  j ) that satisfies (log( Pi ) โˆ’ d (^) 02 ( (^) ~ X (^) jk , M ~ (^) i ) / 2 > log( P (^) j ) โˆ’ d (^) 02 ( (^) ~ X (^) jk , (^) ~ Mjk ) / 2 ) ,

then the extracted point X ~ (^) jk is misclassified. The estimate of prediction error rate is

the ratio of the sum of misclassified case weights and the sum of all case weights. To reduce computation time, the linear discriminant method is used instead of the canonical discriminant method. The theoretical solution is exactly the same for both methods.

Rotations

Varimax rotations may be performed on either the matrix of canonical discriminant function coefficients or on that of the correlation between the canonical discriminant functions and the discrimination variables (the structure matrix). The actual algorithm for the rotation is described in FACTOR. For the Kaiser normalization

h

w w

r

i

ii ii

ik k

m

2 2 1

R

S

| ||

T

| | |

โˆ—

=

โˆ‘

squared multiple correlation

if coefficients rotated

if correlations rotated

a f

The unrotated structure matrix is

R = S โˆ’ 111 W^11 V

If the rotation transformation matrix is represented by K , the rotated standardized coefficient matrix D R is given by

D R = DK