statdivlab / corncob

Count Regression for Correlated Observations with the Beta-binomial
102 stars 22 forks source link

Dispersion #137

Closed kmdesorcy closed 6 months ago

kmdesorcy commented 2 years ago

Hello,

I'm new to corncob. I'm trying to create a model that tests differential abundance of a gut microbiome community based on variables A, B, and C with covariates D and E. I've come up with the following model by trying to adapt what I've read in vignettes:

example <- differentialTest(formula = ~ A + B + C, phi.formula = ~ A + B + C, formula_null = ~ 1, phi.formula_null = ~ D+ E, data = data1, test = "Wald", boot = FALSE, fdr_cutoff = 0.05)

I'm wondering if anyone with expertise using corncob can confirm that I've set my model up to test as intended? I'm a little confused about testing while controlling for effects on dispersion? If anyone could elaborate or post a resource, that would be great. I've read the cited publication.

Thank you!

adw96 commented 6 months ago

My apologies for the delay in responding, @kmdesorcy . We picked up the maintenance of corncob and are still clearing our backlog.

In any hypothesis test, you need to make sure that your full/alternative models (for both means and dispersions) are subsets of your restricted/null models.

~1 is indeed a restriction of ~A + B + C (so your mean model is fine), but ~ D + E is not a restriction of ~ A + B + C. Alternatives include:

and so on.

In general most people are interested in differential abundance, so my general advice is that if you care about D and E, you should include them in your formula. Including them in phi.formula reflects a less common scientific question.

I hope this helps -- feel free to reopen if not.