0

I'm trying to find if soil PH levels differ between 3 species of violet. I'm performing a one way ANOVA test in R and entered the text as follows:

anova<-aov(viola$PH~viola$species)
summary(anova)

This seems like it should be simple and I've done similar tests before, but when I run this, all I get is the degrees of freedom, sum sq, and mean sq. Any help would be appreciated.

ialm
  • 8,510
  • 4
  • 36
  • 48
user3019620
  • 1
  • 1
  • 3
  • Is the dataset public, or could you provide a sample? Otherwise, I cannot reproduce the problem. – TWL Nov 21 '13 at 22:57
  • http://stackoverflow.com/questions/3366506/extract-p-value-from-aov – rawr Nov 21 '13 at 22:58
  • i'm not really sure but its a very simple dataset. just two columns, one being "species" containing triloba, sororia, and sagitata and the other being "PH", with the values 5.25, 5.1, and 4.92 respectively – user3019620 Nov 21 '13 at 23:03
  • no, there is a single PH value for each species that is a mean of 8 other values not present in this dataset – user3019620 Nov 21 '13 at 23:15
  • If there are no replicates, multiple pH values per species, the anova cannot compute the variance, which would explain the lack of p-values. It cannot assess the statistical significance. You would only get the mean across the groups and the residuals. – TWL Nov 21 '13 at 23:19
  • Discard the mean values, and use the original replicated data values as an input to anova. This should fix your problem. – TWL Nov 21 '13 at 23:30
  • so if i replaced the mean values with the raw data, meaning the 8 samples for each species, that would work? – user3019620 Nov 21 '13 at 23:32
  • Yes, then you should be able to extract the p-value with `summary(anova)[[1]][1,"Pr(>F)"]` or via `TukeyHSD` function. – TWL Nov 21 '13 at 23:39

1 Answers1

1

Anova requires replicates to assess the variance and compute the statistic. Discard the mean values, and use the original replicated data as an input to anova. Then you can extract the p-values with summary(anova) or TukeyHSD(anova).

TWL
  • 2,290
  • 1
  • 17
  • 21