-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NAs and 1s in ancombc2 primary result table #266
Comments
It is possible your mix-effect model did not fit your data well. You can try to change the fixed effect variables and random effect variable in your model. |
I have removed the random effect to see if it was related to that and used a different dataset and still get NA for some taxa when using ancombc2. What would you suggest is the potential problem? |
Could you please specify your model and provide some summary statistics of the variables you included in your model? |
Hi @Maggie8888 , I got the same error as well. Unfortunately, I can't reproduce the errror because I work with sensitive data. However, here is my formula
I did some testing and it is not related to structural zeros andd neg_lb parameters or grouping var, it seems associated with a specific vairabile, in my case |
Hi @Maggie8888,
When Any advice is highly appreciated, thank you! |
I resolved the issue! Through simulated data, I discovered that random effect models are incompatible with the ANCOMBC2 global test (see #262 ). Additionally, the global test can fail if the model includes too many variables relative to the number of observations—each category within a variable is treated as a separate parameter. In my case, removing a single continuous variable resolved the issue. I suspect the failure occurred because the variance-covariance matrix (vcov_hat) becomes too complex or ill-conditioned when the model is overparameterized. This matrix is critical for the global test, and if it's singular or poorly estimated, the test cannot compute valid statistics AKA fails. Simplifying the model by removing non-critical variables or categories can prevent this issue. Global tests in general are inherently more sensitive to overparameterization because they depend on the joint behavior of all model parameters, while non-global tests evaluate parameters independently. That explains why pairwise comparisons and Dunn's-like test did not fail whereas on the global test failed, in my case at least. In general, it has been long suggested to use the "10 events per variable" rule otherwise models with fewer than 10 observations per variable tend to overfit and produce unstable estimates. |
Dear Huang,
Thank you for the ANCOMBC package.
When I run ancombc2 - with fixed and random effects (in R 4.4.0) - I noticed that for some of the features all the "lfc_" columns appear as NA and the "p_" and "q_" columns as 1.
In addition, I get a warning message:
"In rbind(c(
(Intercept)
= 83.9999999980089, age = 83.9999999980259, :number of columns of result is not a multiple of vector length (arg 18)"
This happened independent of taxa level tested (I tried genus, family and order). I could not find any posted issue describing that, and I cannot see any particular problem with the features that appear as NA. I used only default settings.
Do you know what could be the issue?
Thank you
The text was updated successfully, but these errors were encountered: