Adjusting for covariates with "formula = " in ancombc() #24
-
Hello, What is the purpose of the "formula" variable in the function? I had initially assumed it would adjust for covariates similar to ANCOM adj_formula and rand_formula (https://github.com/FrederickHuangLin/ANCOM), however changing the formula doesn't appear to change the results for whatever is input for "group = " Further, the documentation says "Specifying group is required for detecting structural zeros and performing global test," and, as one would guess, the differentially abundant taxa are different for a factor when it is listed as the group compared to simply being present in the formula. For example, I have factor in my data called "x4." When I had Happy to provide more info if anyone thinks they can help. I just don't understand what the "formula" variable is doing. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @brynaR, Thanks for your interest in ANCOMBC! Per your question, you can treat The reason why you got inconsistent results using different
before running the Hope it helps! |
Beta Was this translation helpful? Give feedback.
Hi @brynaR,
Thanks for your interest in ANCOMBC!
Per your question, you can treat
formula
as specifying independent variables in a linear model (in log scale, though). Therefore, in your case, if the variable of interest isx4
, and you specifyformula = "x4 + period"
, it means you are trying to detect differentially abundant taxa with regards tox4
while adjustingperiod
effect. As you can see, it does not matter whether the variable of interest specified in theformula
is continuous or discrete. However, it is not the case when it comes to the test for structural zeros or the global test. For example, due to the definition of the global test (a taxon is differentially abundant in at leas…