Discriminant Analysis
James H. Steiger
Department of Psychology and Human Development Vanderbilt University
James H. Steiger (Vanderbilt University) 1 / 54
Discriminant Analysis James H. Steiger Department of Psychology and - - PowerPoint PPT Presentation
Discriminant Analysis James H. Steiger Department of Psychology and Human Development Vanderbilt University James H. Steiger (Vanderbilt University) 1 / 54 Discriminant Analysis Introduction 1 Classification in One Dimension 2 A Simple
James H. Steiger (Vanderbilt University) 1 / 54
1
2
3
4
5
6
James H. Steiger (Vanderbilt University) 2 / 54
Introduction
James H. Steiger (Vanderbilt University) 3 / 54
Classification in One Dimension
James H. Steiger (Vanderbilt University) 4 / 54
Classification in One Dimension
1
2
1
2
1
2
James H. Steiger (Vanderbilt University) 5 / 54
Classification in One Dimension A Simple Special Case
James H. Steiger (Vanderbilt University) 6 / 54
Classification in One Dimension A Simple Special Case
1
2
James H. Steiger (Vanderbilt University) 7 / 54
Classification in One Dimension A Simple Special Case
Normal Distributions, Means = 65,70 SD = 2.5
x 52.0 54.5 57.0 59.5 62.0 64.5 67.0 69.5 72.0 74.5 77.0 79.5 x
James H. Steiger (Vanderbilt University) 8 / 54
Classification in One Dimension A Simple Special Case
James H. Steiger (Vanderbilt University) 9 / 54
Classification in One Dimension A Simple Special Case
Normal Distributions, Means = 65,70 SD = 2.5
x 52.0 54.5 57.0 59.5 62.0 64.5 67.0 69.5 72.0 74.5 77.0 79.5 x
James H. Steiger (Vanderbilt University) 10 / 54
Classification in One Dimension A Simple Special Case
James H. Steiger (Vanderbilt University) 11 / 54
Classification in Two Dimensions
James H. Steiger (Vanderbilt University) 12 / 54
Classification in Two Dimensions
James H. Steiger (Vanderbilt University) 13 / 54
Classification in Two Dimensions
> plot(height[1:50],weight[1:50],pch=1,col="red",xlab="Height",ylab="Weight") > points(height[51:100],weight[51:100],pch=2,col="blue") > legend("bottomright",c("female","male"),pch=c(1,2),col = c("red","blue")) 58 60 62 64 66 68 70 80 100 120 140 160 180 Height Weight female male
James H. Steiger (Vanderbilt University) 14 / 54
Classification in Two Dimensions
James H. Steiger (Vanderbilt University) 15 / 54
Classification in Two Dimensions
James H. Steiger (Vanderbilt University) 16 / 54
Classification in Two Dimensions
James H. Steiger (Vanderbilt University) 17 / 54
Classification in Two Dimensions The Two-Group Linear Discriminant Function
James H. Steiger (Vanderbilt University) 18 / 54
Classification in Two Dimensions The Two-Group Linear Discriminant Function
James H. Steiger (Vanderbilt University) 19 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 20 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 21 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 22 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 23 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
> plot(height[1:50],weight[1:50],pch=1,col="red",xlab="Height",ylab="Weight") > points(height[51:100],weight[51:100],pch=2,col="blue") > legend("bottomright",c("female","male"),pch=c(1,2),col = c("red","blue")) > abline(cutoff/a[2],-(a[1]/a[2])) 58 60 62 64 66 68 70 80 100 120 140 160 180 Height Weight female male
James H. Steiger (Vanderbilt University) 24 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 25 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
> plot(height[1:50],weight[1:50],pch=1,col="red",xlab="Height",ylab="Weight") > points(height[51:100],weight[51:100],pch=2,col="blue") > legend("bottomright",c("female","male"),pch=c(1,2),col = c("red","blue")) > abline(cutoff/a[2],-(a[1]/a[2])) > points(centroid.1[1],centroid.1[2],pch=19,cex=2,col="red") > points(centroid.2[1],centroid.2[2],pch=17,cex=2,col="blue") > xs <- c(centroid.1[1],centroid.2[1]) > ys <- c(centroid.1[2],centroid.2[2]) > lines(xs,ys) > points(mid.point[1],mid.point[2],pch=19,cex=2,col="black") > point.slope.line(mid.point,a[2]/a[1],lty=2,col="red") 58 60 62 64 66 68 70 80 100 120 140 160 180 Height Weight female male > discriminant.scores <- a[1]*height + a[2]*weight > W.hat <- discriminant.scores - cutoff
James H. Steiger (Vanderbilt University) 26 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 27 / 54
Classification in Two Dimensions Plotting the Two-Group Discriminant Function
James H. Steiger (Vanderbilt University) 28 / 54
Classification in Two Dimensions Unequal Probabilities of Group Membership
James H. Steiger (Vanderbilt University) 29 / 54
Classification in Two Dimensions Unequal Probabilities of Group Membership
James H. Steiger (Vanderbilt University) 30 / 54
Classification in Two Dimensions Unequal Probabilities of Group Membership
James H. Steiger (Vanderbilt University) 31 / 54
Classification in Two Dimensions Unequal Costs
James H. Steiger (Vanderbilt University) 32 / 54
More than Two Groups Generalizing the Classification Score Approach
James H. Steiger (Vanderbilt University) 33 / 54
More than Two Groups Generalizing the Classification Score Approach
James H. Steiger (Vanderbilt University) 34 / 54
More than Two Groups Generalizing the Classification Score Approach
James H. Steiger (Vanderbilt University) 35 / 54
More than Two Groups Generalizing the Classification Score Approach
James H. Steiger (Vanderbilt University) 36 / 54
More than Two Groups An Alternate Approach: Canonical Discriminant Functions
James H. Steiger (Vanderbilt University) 37 / 54
More than Two Groups An Alternate Approach: Canonical Discriminant Functions
James H. Steiger (Vanderbilt University) 38 / 54
More than Two Groups An Alternate Approach: Canonical Discriminant Functions
James H. Steiger (Vanderbilt University) 39 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 40 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 41 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 42 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 43 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 44 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 45 / 54
More than Two Groups Tests of Significance
James H. Steiger (Vanderbilt University) 46 / 54
Canonical Dimensions in Discriminant Analysis
James H. Steiger (Vanderbilt University) 47 / 54
Canonical Dimensions in Discriminant Analysis
1
2
3
4
5
6
James H. Steiger (Vanderbilt University) 48 / 54
Canonical Dimensions in Discriminant Analysis
James H. Steiger (Vanderbilt University) 49 / 54
Canonical Dimensions in Discriminant Analysis
Here is the plot of the scores.
> Plot.Discriminant.Scores(x,D,H,Group)
−4 −3 −2 −1 1 2 −2 −1 1 2 3
Plot of Canonical Discriminant Scores
Discriminant Function 1 Discriminant Function 2 Group 1 2 3
James H. Steiger (Vanderbilt University) 50 / 54
Canonical Dimensions in Discriminant Analysis
i =
James H. Steiger (Vanderbilt University) 51 / 54
Canonical Dimensions in Discriminant Analysis
James H. Steiger (Vanderbilt University) 52 / 54
Statistical Variable Selection in Discriminant Analysis
James H. Steiger (Vanderbilt University) 53 / 54
Statistical Variable Selection in Discriminant Analysis
> ## stepwise discriminant analysis > library(klaR) > options(digits=4,scipen=10,width=70) > fit <- greedy.wilks(GROUP ~ ., + data=fb.data,niveau = .10) > fit Formula containing included variables: GROUP ~ EYEHD + WDIM + JAW + EARHD <environment: 0x0000000017f3a060> Values calculated in each step of the selection procedure: vars Wilks.lambda F.statistics.overall p.value.overall 1 EYEHD 0.4279 58.16 9.182e-17 2 WDIM 0.4003 24.96 2.604e-16 3 JAW 0.3383 20.38 6.677e-18 4 EARHD 0.3072 16.89 2.888e-18 F.statistics.diff p.value.diff 1 58.162 9.182e-17 2 2.964 5.687e-02 3 7.791 7.766e-04 4 4.257 1.730e-02
James H. Steiger (Vanderbilt University) 54 / 54