Reputation: 65
I want to use a MANOVA test in R to check for a statistical difference between a vector of means ("test") and a vector (of equal length) of '1's ("random"). My data is as below:
ID openwater closedshrubland barren cropnatural crop decidbroad mixed
test 0.8435707 1.037015 0.90612 0.8724474 0.9837284 1.035505 1.05059
random 1 1 1 1 1 1 1
When I run the following code:
manovares1 <- manova(cbind(openwater,closedshrubland,barren,cropnatural,crop,decidbroad,mixed) ~ as.factor(ID),data=test)
The print out gives me the following message:
Error in print.aov(list(coefficients = c(1, -0.156429334, 1, 0.0370145719999997, :
length of 'dimnames' [1] not equal to array extent
And the summary(manovares1)
gives:
Df
as.factor(ID) 1**
Any ideas what I am doing wrong? (A similar question was asked here, but the answer doesn't seem to help in my situation.
Thanks for any help you can offer!
Upvotes: 2
Views: 258
Reputation: 38
I'm not sure what's going on with your database, but I bet that's the problem.
What exactly are your IDs, is it the openwater, etc.? In this case, this is what's wrong, cause every group in the factor has exactly one case. No program will give you better results when looking at variance. Since there is none.
Upvotes: 0