Skip to content
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

running anova with multigroup analysis #186

Open
rbutleriii opened this issue Jan 13, 2025 · 1 comment
Open

running anova with multigroup analysis #186

rbutleriii opened this issue Jan 13, 2025 · 1 comment

Comments

@rbutleriii
Copy link

Hello, I am trying a four group analysis, and wanted to pass anova to the plot_context_boxplot function. I get the error:

Error in `mutate()`:In argument: `test = map(...)`.
Caused by error in `map()`:In index: 1.
Caused by error in `UseMethod()`:
! no applicable method for 'anova' applied to an object of class "formula"
Backtrace:1. ├─liana::plot_context_boxplot(...)
  2. │ └─... %>% ...
  3. ├─dplyr::mutate(., across(where(is.numeric), ~round(.x, digits = 4)))
  4. ├─dplyr::mutate(., p.adj = p.adjust(p.value, method = "fdr"))
  5. ├─tidyr::unnest(., test)
  6. ├─dplyr::mutate(...)
  7. ├─dplyr:::mutate.data.frame(...)
  8. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  9. │   ├─base::withCallingHandlers(...)
 10. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
 11. │     └─mask$eval_all_mutate(quo)
 12. │       └─dplyr (local) eval()
 13. ├─purrr::map(...)
 14. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
 15. │   ├─purrr:::with_indexed_errors(...)
 16. │   │ └─base::withCallingHandlers(...)
 17. │   ├─purrr:::call_with_cleanup(...)
 18. │   └─liana (local) .f(.x[[i]], ...)
 19. │     ├─broom::tidy(...)
 20. │     ├─rlang::exec(...)
 21. │     └─stats::anova(...)
 22. └─base::.handleSimpleError(...)
 23.   └─purrr (local) h(simpleError(msg, call))
 24.     └─cli::cli_abort(...)
 25.       └─rlang::abort(...)
Execution halted

Is this because multiple-group testing hasn't been implemented?

@rbutleriii
Copy link
Author

Update, when running with aov instead it works. The warning messages seem like it is because I have paired = FALSE included in the call which is fine.

Warning message:
There were 10 warnings in `mutate()`.
The first warning was:In argument: `test = map(...)`.
Caused by warning:
! In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
 extra argumentpairedwill be disregardedRun `dplyr::last_dplyr_warnings()` to see the 9 remaining warnings. 

One notable thing though is that each factor is now plotted twice (second padj is NA). is that just trying to plot padj for the residuals? Thoughts on correcting?
R8 PS19_C31 custom1 all boxplot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant