I want to plot a boxplot figure using ggpaired from ggpubr to compare the two conditions of the following dataframe. So you can see that the csv consists of 3 data pairs (-FLS, UT) coming from 3 experiments (E2020-36, E2021-04, E2021-06). Calculation of p-value is done using stat_compare_means, however, I have the feeling that the wrong values are paired when I run a paired t-test. When I run an unpaired test, p = 0.032. When I run a paired T-test, p = 0.094. However, in my view a paired t-test would be appropriate for this calculation, since the pairs to be compared come from 3 separate biological replicates. So this should result rather in an even lower p-value than in a higher one. Maybe someone can help me out and explain what's happening here...
Thanks, Max
testdata.csv:
"condition","experiment","CD69"
"UT","E2020-36",15.2
"-FLS","E2020-36",5.47
"UT","E2021-04",17.45
"-FLS","E2021-04",4.98
"UT","E2021-06",10.9
"-FLS","E2021-06",7.8
Code:
test1 <- read.csv("testdata.csv")
ggpaired(test1, x = "condition", y = "CD69", id = "experiment",
color = "condition", line.color = "gray", line.size = 0.4,
palette = "jco") +
labs(y = "% CD69+", subtitle = "N = 3 patients (biol. replicates), paired t-test") +
stat_compare_means(method = "t.test", paired = TRUE)