Replies: 1 comment 1 reply
-
Hi @aston9090, In your case, it seems that the variables df <- data.frame(y = log(x[, 1] + 1), meta)
fit <- lm(y ~ Subgroup + Group, data = df)
summary(fit) If there is a high correlation between It is generally recommended to avoid including highly correlated independent variables in regression models to prevent multicollinearity. Consider choosing one of the variables or exploring alternative modeling approaches if both variables are important for your analysis. Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hello, thanks for developing the package! Unfortunately I am new to microbiome analysis and I encountered some errors using ANCOMBC2.
I have data from 12 species (each with 10 samples) that are divided into 3 groups, with 4 species in each group. I would like to test if there are differentially abundant microbiota in each group, accounting for the within-group variations (caused by animal species) at the same time. I tried the following code:
`
Sample <- paste0("Sample", 1:120)
Group <- rep(c("A", "B", "C"), each = 40)
Subgroup <- rep(rep(c("A1", "A2","A3","A4", "B1", "B2", "B3","B4", "C1", "C2","C3","C4"), each = 10))
combine the columns into a data frame
meta <- data.frame(Sample, Group, Subgroup)
rownames(meta)<-meta$Sample
Count generation
number of ASVs (na)
na <- 100
x <- rnbinom(120*na, .1, mu = 100)
x <- matrix(x, nrow = 120, ncol = na)
colnames(x) <- paste0("ASV", 1:na)
rownames(x) <- paste0("Sample", 1:120)
Final phyloseq experiment
exp <- phyloseq(
otu_table(x, taxa_are_rows = FALSE),
sample_data(meta)
)
#ANCOMBC2
trial <- ancombc2(data = exp, fix_formula = "Subgroup + Group", tax_level="Species")
`
And got an error:
Error: Estimation failed for the following covariates: GroupB, GroupC Consider removing these covariates
Any help and advice would be much appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions