I have run a PCA, and am running the first axis into a simple univariate anova. I want to know if the order of terms matters, however when I run the second order of terms (with the PCA variation being includd second) i get the following error
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'
In addition: Warning message:
In storage.mode(v) <- "double" : NAs introduced by coercion
I have checked and there are no NAs in either my x or y. The PCA is a double, I coerced it into an integer, and it still did not work, giving me the same message.
Nut<-PCA.all$scores[,1]
summary.aov(aov(Nut~type, courtney.leaf1))
summary.aov(aov(type~Nut, courtney.leaf1))
The output:
> Nut<-PCA.all$scores[,1]
> summary.aov(aov(Nut~type, courtney.leaf1))
Df Sum Sq Mean Sq F value Pr(>F)
type 1 170.33 170.33 234 <2e-16 ***
Residuals 63 45.86 0.73
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> summary.aov(aov(type~Nut, courtney.leaf1))
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'
In addition: Warning message:
In storage.mode(v) <- "double" : NAs introduced by coercion
As you can see, the rearrangement of terms where the categorical term is first does not work.
Thank you!