0

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()?

sth
  • 265
  • 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 03 '15 at 02:13
  • @ttnphns. Can you elaborate? What would the response variable be and what would the factors be? Thank you. – sth Mar 03 '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 03 '15 at 19:08
  • 1
    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 03 '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 03 '15 at 22:32
  • Sounds like a good idea! – sth Mar 04 '15 at 20:12
  • Excuse me @ttnphns when you say the discriminants I guess you're talking about the coefficients of linear discriminants? Run this: anova(coefficients ~ class)? But I have just one coefficient value? – Javier Hernando Jan 17 '24 at 10:39
  • @JavierHernando, why? By discriminants per se I mean the discriminant variates, their values, not the coefficients. See algebra of lda here https://stats.stackexchange.com/a/48859/3277 – ttnphns Jan 19 '24 at 00:39

0 Answers0