0
votes

when I run qda using a certain number of variables but when I try to add a new one it generates the error i tried checking the variables and they satisfy the conditions when I remove one of the already used variables with the new one that I wanted to add it works and when I plug the old one back in it generates the same error.

    model=qda(data=males,ZONE~log(L)+log(LT)+log(HG)+log(HD)+log(HS)+log(LB)+log(LH)+log(LP)+log(PP)+log(PF))
#this code works fine

#adding a new variable from the same dataset and it's numeric 
model_2=qda(data=males,ZONE~log(L)+log(LT)+log(HG)+log(HD)+log(HS)+log(LB)+log(LH)+log(LP)+log(PP)+log(PF)+log(TP))

#this generates the error 'some variable is too small for qda
#now i replace one of the existing variables with the one i wanted to add
model_3=qda(data=males,ZONE~log(L)+log(LT)+log(HG)+log(HD)+log(HS)+log(LB)+log(LH)+log(LP)+log(PP)+log(TP))
## i replaces log(PF) with log(TP) and it worked so the problem is not in the variable

any suggestions of what might be causing this?

1
how many variables and how many samples do you have ? can you post your data? or a portion of your data here ?user1267127
i don't know the appropriate way to post data as this is my first post on the site. i have 63 rows and 35 columns 14 of which are categorical and 19 numerical (continuous) and i didn't use any categorical variables in the model. so far i've been able to use only 10 variablesoussama_ag

1 Answers

0
votes

The problem seems to be that you have more variables (columns) than the smallest of your classes. You need to reduce the number of variables or use a LDA instead.