StatTools : Discriminant Analysis (Plotting Discriminant Map) Program

Links : Home Index (Subjects) Index (Categories) Contact StatTools

Related link :
Discriminant Analysis Explained Page
Discriminant Analysis (Analysis Using Reference Data) Program Page
Discriminant Analysis (Use of Coefficients on New Data) Program Page

Program References
Group Centroids
g rows for g groups
2 columns for scores of 2 functions

Function Scores.
Each row a case
2 columns of Discriminant Function Scores

Array of of A Priori Probabilities g groups
Relative frequencies or probability

Array of Costs Coefficients g groups
Relative cost or loss if wrongly not assigned

The plot is for any combination of 2 functions defining coordinates for more than 2 groups in a 2 dimensional map

The centroid values are created using reference data from the Discriminant Analysis (Analysis Using Reference Data) Program Page

The Function scores are calculated using data from the Discriminant Analysis (Use of Coefficients on New Data) Program Page

Please Note : In an analysis, there may be multiple groups and multiple functions,
but the plot can only show the groups using any 2 of the functions. Where more than two functions are produced,
users need to do multiple plots of 2 functions each time to fully visualize the relationship between the groups
in the multidimensional Euclidian space.

The centroid and function scores matrices must therefore be two columns, and they must be from the same two functions

The apriori is the probability of belonging to a group before the test. The known population proportions
or sample size of each group can be used. If apriori is unknown or not needed, use the same number for each group

The cost for a group is a measure of disadvantage incurred if a case is wrongly not assigned to that group.
Any measurement (money, risks, blood loss, etc) can be used providing the same measurements are used
for all groups. If there is no cost involved, use the same number for the each groups.

The number of elements in the apriori and cost array must be the same as the number of rows in the centroid matrix,
the number of groups.
The default example data uses 3 groups.

If more than 3 groups are involved, the groups may overlap in some dimensions, and the background map only shows the color
of the most dominant group for any pair of value. This program allows a maximum of 7 groups to be plotted, the colors are:

    Group 1              Group 2              Group 3              Group 4              Group 5              Group 6              Group 7         

MacroPlot Code