Hi there
So I seem to be struggling with running any of the statistical tests, I believe because my data is not normally distributed (according to shapiro wilkes test) I technically need to run a Kruskall Wallis test(?). Originally I realised I needed to restructure my matrix into a vector, which I have now done, so that I have the 1st column containing the Simpsons index values across all the samples, and then the 2nd (group column) containing labels of the taxanomic phyla these values are associated with.
I am trying to run a statistical significance test to see if there is a significant difference between one of the taxanomic phyla groups and the other phyla groups, in terms of the simpsons Index values.
tmp_vector=as.vector(tmp)
tmp_vector
labels=as.vector(sapply(colnames(tmp), function(i){rep(i, dim(tmp)[1])}))
labels
fungi_vector = cbind(tmp_vector, labels)
fungi_vector
The former is the code I used to generate my vector.
And here is a snippet of the output.
Could do with some help as to figuring out how to run the test I need to as I'm not very experienced with R.
Regards
So would this then compare if there's a statistically significant difference across all of the groups? There are several more phyla groups in the dataset.
The objective was to basically determine if there was a statistically significant difference between Ascomycota and the other phyla in the data.
Although using the code you showed me has definitely worked in giving me a P value when I run the Kruskall Wallis on the whole dataset.
Yes.
In this case, please try Dunn's post-hoc test via
FSA::dunnTest()
( see https://www.rdocumentation.org/packages/FSA/versions/0.8.32/topics/dunnTest ). This can be run in the same way askruskal.test()
Would the Pairwise Wilcoxon test also be relevant? Since I am trying to find out specifically the significant differences between groups? That looks like it shouldn't be too hard to code for either.
If they are logically paired, then no problem using the Wilcoxon, of course.