# Using results of Canonical Discriminant Analysis to get overall variable importance?

I have a dataset with thousands of observations pre-assigned to 18 groups and with measures for 8 different variables. I am using canonical discriminant analysis to see how separable my 18 groups are. What I am actually most interested in is which individual variable separates the groups most (and least).

I have tried running canonical discriminant analysis in R using the ldm() function from the MASS library.

mydata.lda <- lda(group ~ x1 + x2 + x3 .... + x8, data=mydata)


If I understand correctly, the output has coefficients of linear discriminant which indicates how strongly each variable is associated with each individual discriminant function, and I could standardize the coefficients to help interpret the meanings of the resultant discriminant functions.

I think what I want however is the partial F-square of each individual variable, or the relative ability of each variable to separate groups across all discriminant functions, not one at a time. In SPSS, the discriminant analysis function allows one to ask for "univariate ANOVAs" which seem to produce what I want: a table showing the Wilks' Lambda statistic and F statistics for each of my 8 variables. How would I get this kind of output in R? Do I need to run a (M)ANOVA based on the output of my lda()?

• You are probably speaking of ANOVAs performed on each extracted canonical variate, called discriminant in LDA. Just save the discriminants from the procedure - their values, and perform the univariate ANOVAs yourself. – ttnphns Mar 3 '15 at 2:13
• @ttnphns. Can you elaborate? What would the response variable be and what would the factors be? Thank you. – sth Mar 3 '15 at 19:01
• In SPSS, select Save - Discriminant scores. I don't know how it is in R. Each discriminant is then analyze as response variable in ANOVA; the factor is the grouping variable. – ttnphns Mar 3 '15 at 19:08
• Ok. I think we are speaking of different things. When I do what you suggest, I can get results that indicate how separable the grouping variable is for each discriminant (linear function). What I actually want is how separable is the grouping variable with respect to each individual predictor variable that was used to create the discriminants. – sth Mar 3 '15 at 19:25
• You don't seem to need LDA at all! Why don't you simply run an ANOVA for each of your predictor variables, and look at the F statistic for each of them? – amoeba Mar 3 '15 at 22:32