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

(Wrong) warning messages when using group_by with anova_test #120

Open
cbsteh opened this issue Aug 16, 2021 · 1 comment
Open

(Wrong) warning messages when using group_by with anova_test #120

cbsteh opened this issue Aug 16, 2021 · 1 comment

Comments

@cbsteh
Copy link

cbsteh commented Aug 16, 2021

library(tidyverse)
library(rstatix)

df <- tribble(
  ~id, ~time, ~rpm, ~ratio, ~val,
  1,   0,     50,   1,      6.49,
  2,   0,     50,   1,      6.51,
  3,   0,     80,   1,      6.49,
  4,   0,     80,   1,      6.49,
  5,   0,     50,   3,      6.56,
  6,   0,     50,   3,      6.56,
  7,   0,     80,   3,      6.50,
  8,   0,     80,   3,      6.44,
  9,   0,     50,   6,      6.52,
  10 , 0,     50,   6,      6.59,
  11,  0,     80,   6,      6.65,
  12,  0,     80,   6,      6.60,
  1,   3,     50,   1,      4.61,
  2,   3,     50,   1,      4.80,
  3,   3,     80,   1,      4.33,
  4,   3,     80,   1,      4.36,
  5,   3,     50,   3,      4.81,
  6,   3,     50,   3,      4.70,
  7,   3,     80,   3,      4.80,
  8,   3,     80,   3,      4.82,
  9,   3,     50,   6,      4.60,
  10 , 3,     50,   6,      4.63,
  11,  3,     80,   6,      4.74,
  12,  3,     80,   6,      4.72
)

df <-df %>% mutate(across(id:ratio, as.factor))

twoway_1 <- df %>%
  group_by(time) %>%
  anova_test(dv = val, wid = id, between = c(rpm, ratio))  # OK
twoway_1

twoway_2 <- df %>%
  group_by(rpm) %>%
  anova_test(dv = val, wid = id, between = c(time, ratio)) # Warning messages
twoway_2

The warning messages I get are:

Warning: Problem with `mutate()` column `data`.
i `data = map(.data$data, .f, ...)`.
i The 'wid' column contains duplicate ids across between-subjects variables. Automatic unique id will be created.

I do not believe the error is in my data entry as I have used in verbatim other external data and they all give the same warning messages.

@MonicaCalSan
Copy link

Have you find a solution? I have just exactly the same error:

Error: Problem with `mutate()` column `data`.
i `data = map(.data$data, .f, ...)`.
x 0 (non-NA) cases

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

2 participants