0

I'm currently running a test for some students I mentor. They designed a field experiment where they're trying to see the influence of phosphates, nitrates, and pH on plankton abundance in three different locations (Guzzlers). I designed this ANOVA (however I realize now that some other test may fit best) and got an output that I've pasted below. The ANOVA seemed to run but after trying for a Tukey post-hoc I got an error. The data may not be parametric, so I'm wondering if a multiple regression model may be best instead? Or did I simply design the ANOVA incorrectly?

Thank you!

Here is my code:

practiceanova <- aov(WQAbundancebyGuzzler$Abundance[factor(WQAbundancebyGuzzler$Guzzler..)] ~ WQAbundancebyGuzzler$Phospates, na.rm=TRUE)
anova(practiceanova)
TukeyHSD(practiceanova, na.rm=TRUE)

Output:

> practiceanova<-aov(WQAbundancebyGuzzler$Abundance[factor(WQAbundancebyGuzzler$Guzzler..)] ~ WQAbundancebyGuzzler$Phospates, na.rm=TRUE)
Warning message:
In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
 extra argument ‘na.rm’ will be disregarded 
> anova(practiceanova)
Analysis of Variance Table

Response: WQAbundancebyGuzzler$Abundance[factor(WQAbundancebyGuzzler$Guzzler..)]
                               Df Sum Sq Mean Sq F value
WQAbundancebyGuzzler$Phospates  1 3700.8  3700.8  7.6667
Residuals                       8 3861.7   482.7        
                                Pr(>F)  
WQAbundancebyGuzzler$Phospates 0.02434 *
Residuals                               
---
Signif. codes:  
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(practiceanova, na.rm=TRUE)
Error in TukeyHSD.aov(practiceanova, na.rm = TRUE) : 
  no factors in the fitted model
In addition: Warning message:
In replications(paste("~", xx), data = mf) :
  non-factors ignored: WQAbundancebyGuzzler$Phospates
MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • 1
    When asking about error messages, please include your data using `dput()` so others can reproduce the error and try to help. See [how to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Jan Boyer Feb 25 '19 at 22:46
  • Based on the error message "no factors in the fitted model" you need to convert whichever columns are relevant to factors. Beyond that, if the question is about picking a model, you'll probably have better luck at the stats SE site, [Cross Validated](http://stats.stackexchange.com/) – camille Feb 25 '19 at 22:47
  • @camille I tried converting the Guzzlers (location) into factors and proceeded to run the ANOVA and Tukey and continued to get the same error. I noticed that my issue may be I'm trying to compare a quantitative variable (ie. phosphate, nitrate, etc. levels) with the abundance (another quantitative) between multiple locations. Could this be my issue? – Victoria Assad Feb 25 '19 at 23:11
  • Really don't know without a reproducible example – camille Feb 25 '19 at 23:51
  • 1
    Need AT A MINIMUM a complete description of `WQAbundancebyGuzzler`. You are abusing the R formula interface with an argument to `aov` of `WQAbundancebyGuzzler$Abundance[factor(WQAbundancebyGuzzler$Guzzler..)] ~ WQAbundancebyGuzzler$Phospates`. Is there really a column named `Guzzler..`? You _should_ be using a "data" argument rather than referring to the dataframe on both sides of the formula. It's possible this is the basis of your problems but without a full reproducible example it's not an attractive question to spend any time on. – IRTFM Feb 26 '19 at 00:46

0 Answers0