pairiwise paired t test, arguments dont not have the same legnth

I have a data frame structured liked this: Rows: 264 Columns: 4

$id subject:1,2,3,4...
$condition: condition1, condition2, condition3, condition4...
$day of experiment: day1, day2, day3, day4...

i ran a two way anova repeated measures within days (as subjects are the same for the 4 days, and between the conditions

two.way.anova <- anova_test(data, wid=id, dv=score, within= day, between= condition)

there was a significant interaction and and thus i ran a one way anova grouped for day to see the interaction between condition and score

one.way.anova <- data |>   
group_by(day) |> 
anova_test(score~condition) |> 
get_anova_table() |> 

and so i tried to run a pairiwise t test paired with this code: <- data |> 
group_by(day) |> 
pairwise_t_test(score~con, paired = TRUE, p.adjust.method = "bonferroni")

and i get this error

Error: Problem with `mutate()` column `data`.
i `data = map(.data$data, .f, ...)`.
x not all arguments have the same length

i have seen that others had the same problem and they say that data must have the same number on al days of experiment and indeed my data have the same number of subjects on all 4 days when you group them by day?

can anyone see my stuff and maybe understand what is going on?

thank you


To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Short Version

You can share your data in a forum friendly way by passing the data to share to the dput() function.
If your data is too large you can use standard methods to reduce it before sending to dput().
When you come to share the dput() text that represents your data, please be sure to format your post with triple backticks on the line before your code begins to format it appropriately.

( example_df <- structure(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4, 4.6, 
5, 4.4, 4.9), Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9, 3.4, 
3.4, 2.9, 3.1), Petal.Length = c(1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 
1.4, 1.5, 1.4, 1.5), Petal.Width = c(0.2, 0.2, 0.2, 0.2, 0.2, 
0.4, 0.3, 0.2, 0.2, 0.1), Species = structure(c(1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L), .Label = c("setosa", "versicolor", "virginica"
), class = "factor")), row.names = c(NA, -10L), class = c("tbl_df", 
"tbl", "data.frame")))

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.