Brenna, The PCA you performed produces a list of objects, one of which is a matrix of PC scores.
Change AIS.PC to AISPC$x, and it should work. In this case, $x is the matrix of scores. The help files for the functions you use tell you the objects that are returned. You can also use attributes() to see the list of objects returned. The $ indicate that you are going to the list and extracting the object that follows. Just as a cautionary note, you might make sure that the number of columns for x is not the same as the number of landmarks times the dimensions (2 or 3). I cannot remember if R automatically culls the dimensions of x to match the number of positive non-zero eigenvalues. If not, you might have to do that yourself. There are also non-parametric MANOVA options that do not rely on degrees of freedom, which would make theses steps unnecessary, if you are comfortable with using randomization tests. Good luck! Mike Michael Collyer Associate Professor Biostatistics Department of Biology Western Kentucky University 1906 College Heights Blvd. #11080 Bowling Green, KY 42101-1080 Phone: 270-745-8765; Fax: 270-745-6856 Email: [email protected]<mailto:[email protected]> On Apr 5, 2016, at 10:16 AM, Brenna Hays <[email protected]<mailto:[email protected]>> wrote: I have been reading up on MANOVA and come across the common complication requiring a large number of degrees of freedom. After performing Procrustes superimpositions on my landmark configurations, along with my small sample sizes, is not allowing me to perform MANOVA tests. I have read that one can fix this problem by replacing the coordinates with principal components. The coding from my information source is very vague, but I've been trying some different things. Below is my code - note the error message at the bottom. AISarray <- two.d.array(AIS.shape) ID <- c(1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3) Depth <- c(3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5) Region <- c(7, 8, 8, 8, 8, 8, 8, 8, 5, 5, 5) RR <- c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) CDR <- c(2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) AISdf <- cbind(AISarray, ID, Depth, Region, RR, CDR) specs <- as.factor(AISdf[,51]) depth <- as.factor(AISdf[,52]) region <- as.factor(AISdf[,53]) rr <- as.factor(AISdf[,54]) cdr <- as.factor(AISdf[,55]) AIS.PC <- prcomp(AISarray) summary(manova(lm(AIS.PC~specs*region))) #NOT WORKING Error in model.frame.default(formula = AIS.PC ~ specs * region, drop.unused.levels = TRUE) : invalid type (list) for variable 'AIS.PC' It seems MANOVA requires a data frame, but replacing the coordinates with principal components turns it into a list. I cannot find any other information on this matter. Any help would be much appreciated. Thanks, Brenna Hays Research Assistant, Master's Student Nova Southeastern University -- MORPHMET may be accessed via its webpage at http://www.morphometrics.org<http://www.morphometrics.org/> --- You received this message because you are subscribed to the Google Groups "MORPHMET" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. -- MORPHMET may be accessed via its webpage at http://www.morphometrics.org --- You received this message because you are subscribed to the Google Groups "MORPHMET" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
