david-barnett / microViz

R package for microbiome data visualization and statistics. Uses phyloseq, vegan and the tidyverse. Docker image available.
https://david-barnett.github.io/microViz/
GNU General Public License v3.0
106 stars 11 forks source link

How to understand the "grouping" parameter in taxatree_stats_p_adjust() function? #42

Closed Leran10 closed 2 years ago

Leran10 commented 2 years ago

Hi,

I have a questions regarding to the "grouping" parameter in taxatree_stats_p_adjust() function. I can find there is explanation in tutorial page:

Define how to group the p values for adjustment with the grouping argument. The default is to adjust the p values in groups at each taxonomic rank, but you could also adjust per "model" / "taxon" or per "term". Or even group by a combination of rank and term with c("rank", "term")

But still feel confused. Does "groups at each taxonomic rank" mean it adjusts p values based on the number of unique taxa in phylum level (for example)? And does "group by taxon" mean that the calculation is based on the number of entire taxonomy?

And is there an instruction on how to choose grouping parameter?

Thanks so much! Leran

david-barnett commented 2 years ago

Hi Leran, This argument does need better documentation. I will address this in a new version of microViz. 🙂

'rank' means that all the p-values from the tests at one rank, e.g. genus, are adjusted as one group of tests (literally just put into p.adjust() as first argument). The same is done for all other ranks.

'taxon' means the same as 'model'. The p values from one model (so one per covariate) are adjusted as a group. The same is done for all models. These options are therefore much less conservative.