[R] qda(MASS) function error

Mauro Rossi Mauro.Rossi at irpi.cnr.it
Wed Jul 25 18:17:49 CEST 2007

Dear R user,
  I'm using qda (quadratic discriminant analysis) function (package 
MASS) to classify 58 explanatory variables (numeric type with different 
ranges) using a grouping variable (factor 2 levels "0" "1"). I'm using 
the qda method for class 'data.frame' (in this way I don't need to 
specify a formula).
Using the function:
result.qda<-qda(explanatory.variables, grouping.variable, method="moment")
I obtain the following error message:
"Error in qda.default(x, grouping, ...) : rank deficiency in group 0"
I run the script excluding some variables and I've individuated 2 
explanatory variables that give problems, but  I don't understand why 
they give them. The two excluded variables are numeric with two possible 
values: 0 and 1, but in the rest of group of  variables, some similar 
variables are considered.

I don't have this problem using lda  function for linear discriminant 

What does this error message mean?
What types of variables does qda function consider?

Thank in advance,
Mauro Rossi


Mauro Rossi

Istituto di Ricerca per la Protezione Idrogeologica

Consiglio Nazionale delle Ricerche

Via della Madonna Alta, 126

06128 Perugia


Tel. +39 075 5014421

Fax +39 075 5014420

More information about the R-help mailing list