[R] error in manova

Silvia Lomascolo slomascolo at zoo.ufl.edu
Thu Sep 20 21:34:00 CEST 2007


I work with Windows, R 2.4.1.  I'm a beginner with R!

After doing a Discriminant Function Analysis, I am trying to run manova to
get a measure of significance of my lda results. I want to predict groups 1
through 4 using 78 variables (bad group/var ratio, I know, but I'm just
exploring the possibilities right now).  I've tried with a test matrix and I
get my results fine, so I think it might have something to do with the
matrix I'm using (hence, the sample of my matrix I show below). My matrix,
called disperser.mx in my code, looks like:

disperser	P5.38	P6.45	P6.55	P6.63	P7.12	P7.42	P8.10	P8.30	P8.88	P9.09	P9.30
3	0.00	1.34	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	0.00	131.56	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	5.05	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
3	0.00	72.65	103.26	1.09	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.88	0.48	0.89	0.00	0.00	0.16	0.00	0.00	0.00	0.00	0.00
2	0.00	0.00	0.00	0.00	0.00	0.75	0.00	0.00	0.00	0.00	0.00
4	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	0.00	0.00	0.00	0.00	5.41	20.62	0.00	8.13	8.87	8.27
4	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	133.24	0.00	0.73	0.00	0.00	1.34	2.13	0.00	0.00	0.00
1	0.00	11.08	3.16	0.76	0.00	0.00	0.00	0.00	0.00	0.00	0.00
4	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
4	0.82	0.00	0.00	0.00	4.79	0.00	0.00	33.69	0.00	0.00	11.44
2	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
4	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	1.81	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
1	0.00	0.00	0.00	0.00	0.00	6.89	0.00	0.00	0.00	0.00	0.00
2	7.26	8.16	1.50	0.00	1.97	1.28	0.00	4.08	0.00	0.00	1.16
4	0.00	0.00	0.00	0.00	0.00	3.13	0.00	0.00	0.00	0.00	0.00
4	0.00	0.00	0.00	0.00	0.00	0.83	0.00	0.00	0.00	0.00	0.00
1	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
2	0.00	1.48	0.22	0.00	0.00	0.00	1.80	0.00	0.66	0.47	0.47
1	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00	0.00
1	0.00	0.00	0.00	0.00	4.78	0.00	0.00	0.00	0.00	0.00	0.00

...with a lot more variables.  The code I am writing to get a manova is:

##first, the code for the discriminant function, just in case it has
something to do with the error I get later##
disperser.mx$disperser<- as.factor (disperser.mx$disperser)
disperser.df <- lda(disperser~., data=disperser.mx)
predict(disperser.df)
attach(disperser.mx)
table(disperser, predict(disperser.df)$class)  ## so far so good.  I get my
discriminant analysis fine
volatileVar <- disperser.mx[c(2:79)] ## these are all the variables that I
want to use
summary (manova(as.matrix(volatileVar)~disperser.mx$disperser),
test='Wilks')  ## here is where I get an error that says "Error in
summary.manova(manova(as.matrix(volatileVar) ~ disperser.mx$disperser),  : 
        residuals have rank 23 < 78"


I would appreciate any help you can offer! Silvia.


-- 
View this message in context: http://www.nabble.com/error-in-manova-tf4489610.html#a12804209
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list