Open jsaintvanne opened 3 years ago
Hi @jsaintvanne
This does not seem to be an issue of rstatix
. You can remove clusters with identical outcome values by filtering clusters with 0 variance out (see below), but that introduces another error (too few observations). I don't know if tests of statistical significance are really useful in this case; maybe an exploratory data analysis can serve you better.
library(tidyverse)
library(rstatix)
reprex_data <- tribble(
~ data, ~ material, ~ cluster,
-3.00000000, "Mo", 2,
-3.00000000, "Sg", 1,
-3.00000000, "Mo", 2,
-3.00000000, "Sg", 3,
-3.00000000, "Mo", 2,
-3.00000000, "Sg", 3,
-3.00000000, "Mo", 3,
-3.00000000, "Sg", 3,
-0.18015529, "Mo", 2,
-3.00000000, "Mo", 2,
-3.00000000, "Sg", 2,
-3.00000000, "Mo", 2,
-3.00000000, "Mo", 1,
-3.00000000, "Sg", 1,
-3.00000000, "Sg", 1,
-0.27042093, "Mo", 4,
-3.00000000, "Sg", 1,
-3.00000000, "Mo", 2,
-3.00000000, "Sg", 1,
-3.00000000, "Mo", 3,
-3.00000000, "Sg", 2,
-3.00000000, "Mo", 4,
-3.00000000, "Sg", 3,
-3.00000000, "Mo", 2,
-3.00000000, "Sg", 3,
-3.00000000, "Sg", 3,
-3.00000000, "Sg", 3,
-0.59120296, "Mo", 4,
-3.00000000, "Sg", 2
)
reprex_data %>%
group_by(cluster) %>%
filter(var(data) != 0) %>%
wilcox_test(data ~ material, p.adjust.method = "fdr")
#> Error: Problem with `mutate()` column `data`.
#> i `data = map(.data$data, .f, ...)`.
#> x not enough 'y' observations
Created on 2021-10-06 by the reprex package (v2.0.1)
Hi,
I run a script on data wich are classify with material and group by cluster :
I made this thing :
and I obtain an error on my third cluster because I have only one value in this cluster (on different rows but always the same value).
I absolutely need to pass this thing because I run it in a for loop and some clusters have the same values sometimes... So have you a solution for this pliz ?
Thnaks for your help
PS : I made something to exclude this cluster, make a "ghost line" then add it to the stat result but the
add_xy_position
that I run after gives me an NA...