Anova and post hoc Tuckey on multiple components

Hello,

I'm trying to do a One-Way Anova on multiple components and then a TuckeyHSD and store the pvalue of the all permutation

So far this is my code but when I did reprex it work and then it stopped working ... Now I have the error message :

Error: Must group by variables found in `.data`.
* Column `Compound.Name` is not found.
Run `rlang::last_error()` to see where the error occurred.

So I did the following :

> rlang::last_trace()
<error/rlang_error>
Must group by variables found in `.data`.
* Column `Compound.Name` is not found.
Backtrace:
    x
 1. +-`%>%`(...)
 2. +-dplyr::ungroup(.)
 3. +-dplyr::do(., broom::tidy(TukeyHSD(aov(Measured.Area ~ size, data = .))))
 4. +-dplyr::group_by(., Compound.Name)
 5. \-dplyr:::group_by.data.frame(., Compound.Name)
 6.   \-dplyr::group_by_prepare(.data, ..., .add = .add)

any idea as to why it suddently stopped working ?

Cheers,
Arzock


read.csv(file = 'https://filebin.net/9s9pbeg0n5of10jm/test-file-anova.csv?t=8vzw4ugs', header = T) %>% group_by(Compound.Name) %>% do(broom::tidy(TukeyHSD(aov(Measured.Area ~ size, data =.)))) %>% ungroup
#> Warning in qtukey(conf.level, length(means), x$df.residual): NaNs produced
#> Warning in qtukey(conf.level, length(means), x$df.residual): NaNs produced
#> Warning in ptukey(abs(est), length(means), x$df.residual, lower.tail = FALSE):
#> NaNs produced
#> # A tibble: 37 x 8
#>    Compound.Name          term  contrast null.value  estimate conf.low conf.high
#>    <chr>                  <chr> <chr>         <dbl>     <dbl>    <dbl>     <dbl>
#>  1 1-Methyladenosine,tri~ size  M-L               0   -4.22e7  -2.45e8    1.60e8
#>  2 1-Methyladenosine,tri~ size  p-L               0    1.15e6  -2.85e8    2.88e8
#>  3 1-Methyladenosine,tri~ size  S-L               0   -4.05e7  -2.43e8    1.62e8
#>  4 1-Methyladenosine,tri~ size  p-M               0    4.34e7  -2.43e8    3.30e8
#>  5 1-Methyladenosine,tri~ size  S-M               0    1.68e6  -2.01e8    2.04e8
#>  6 1-Methyladenosine,tri~ size  S-p               0   -4.17e7  -3.28e8    2.45e8
#>  7 1-Monopalmitin, 2TMS ~ size  M-L               0    3.27e6  -4.47e6    1.10e7
#>  8 1-Monopalmitin, 2TMS ~ size  p-L               0    1.21e7   1.15e6    2.30e7
#>  9 1-Monopalmitin, 2TMS ~ size  S-L               0    7.28e6  -4.55e5    1.50e7
#> 10 1-Monopalmitin, 2TMS ~ size  p-M               0    8.82e6  -2.12e6    1.98e7
#> # ... with 27 more rows, and 1 more variable: adj.p.value <dbl>
#> Warning in qtukey(conf.level, length(means), x$df.residual): NaNs produced
#> Warning in qtukey(conf.level, length(means), x$df.residual): NaNs produced
#> Warning in ptukey(abs(est), length(means), x$df.residual, lower.tail = FALSE):
#> NaNs produced
#> # A tibble: 37 x 8
#>    Compound.Name          term  contrast null.value  estimate conf.low conf.high
#>    <chr>                  <chr> <chr>         <dbl>     <dbl>    <dbl>     <dbl>
#>  1 1-Methyladenosine,tri~ size  M-L               0   -4.22e7  -2.45e8    1.60e8
#>  2 1-Methyladenosine,tri~ size  p-L               0    1.15e6  -2.85e8    2.88e8
#>  3 1-Methyladenosine,tri~ size  S-L               0   -4.05e7  -2.43e8    1.62e8
#>  4 1-Methyladenosine,tri~ size  p-M               0    4.34e7  -2.43e8    3.30e8
#>  5 1-Methyladenosine,tri~ size  S-M               0    1.68e6  -2.01e8    2.04e8
#>  6 1-Methyladenosine,tri~ size  S-p               0   -4.17e7  -3.28e8    2.45e8
#>  7 1-Monopalmitin, 2TMS ~ size  M-L               0    3.27e6  -4.47e6    1.10e7
#>  8 1-Monopalmitin, 2TMS ~ size  p-L               0    1.21e7   1.15e6    2.30e7
#>  9 1-Monopalmitin, 2TMS ~ size  S-L               0    7.28e6  -4.55e5    1.50e7
#> 10 1-Monopalmitin, 2TMS ~ size  p-M               0    8.82e6  -2.12e6    1.98e7
#> # ... with 27 more rows, and 1 more variable: adj.p.value <dbl>

Created on 2021-04-16 by the reprex package (v2.0.0)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.