Open carolyndoty opened 2 days ago
Hi @carolyndoty,
Thank you for reporting this issue. This error typically occurs in mixed-effects models when there are insufficient observations per subject relative to the model complexity. However, to properly diagnose and resolve the issue, I'll need some additional information:
Could you please share:
You mentioned generate_taxa_indiv_boxplot_long()
works fine - this suggests your data object is properly formatted. The difference is that mStat_generate_report_long()
and generate_taxa_per_time_test_long()
use mixed-effects models, which have stricter requirements for data structure.
As a temporary workaround, you could try:
mStat_generate_report_long(
data.obj = your.data.obj,
group.var = "group",
subject.var = "ID",
time.var = your.time.var,
# Try adding these parameters
feature.analysis.rarafy = FALSE,
feature.mt.method = "none"
)
However, this is just a guess without seeing your actual data structure. With more details about your dataset, I can provide a more targeted solution.
Could you also share the complete code you're using to call these functions? This would help identify if there are any parameter settings that might be contributing to the issue.
Best regards, Chen Yang
When I try to use the mStat_generate_report_long() or generate_taxa_per_time_test_long() I get the error, "! task 1 failed - "number of levels of each grouping factor must be < number of observations (problems: ID)"". For my analysis my grouping variable is called "group" and has two values, "disease" or "control" and my subject variable is "ID". I have no issue running, generate_taxa_indiv_boxplot_long(). Please let me know if there is anything I can do to get these functions to work.