library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.5.2
## Warning: package 'ggplot2' was built under R version 4.5.2
## Warning: package 'tidyr' was built under R version 4.5.2
## Warning: package 'readr' was built under R version 4.5.2
## Warning: package 'purrr' was built under R version 4.5.2
## Warning: package 'stringr' was built under R version 4.5.2
## Warning: package 'forcats' was built under R version 4.5.2
## Warning: package 'lubridate' was built under R version 4.5.2
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.2.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(rstatix)
## Warning: package 'rstatix' was built under R version 4.5.3
##
## Attaching package: 'rstatix'
##
## The following object is masked from 'package:stats':
##
## filter
set.seed(123)
once <- c(10, 12, 15, 11, 14, 18, 13, 16, 12, 14, 15, 11, 13, 12, 16)
sonra <- c(12, 15, 14, 13, 17, 20, 14, 18, 15, 13, 17, 14, 15, 13, 19)
veri_wilcoxon <- data.frame(
Id = 1:15,
Once = once,
Sonra = sonra
)
shapiro_test(once)
## # A tibble: 1 × 3
## variable statistic p.value
## <chr> <dbl> <dbl>
## 1 once 0.966 0.801
shapiro_test(sonra)
## # A tibble: 1 × 3
## variable statistic p.value
## <chr> <dbl> <dbl>
## 1 sonra 0.922 0.209
wilcox.test(veri_wilcoxon$Once, veri_wilcoxon$Sonra, paired = TRUE, exact = FALSE)
##
## Wilcoxon signed rank test with continuity correction
##
## data: veri_wilcoxon$Once and veri_wilcoxon$Sonra
## V = 5, p-value = 0.001708
## alternative hypothesis: true location shift is not equal to 0
veri_uzun <- veri_wilcoxon %>%
pivot_longer(cols = c(Once, Sonra), names_to = "Zaman", values_to = "Skor")
veri_uzun %>% wilcox_effsize(Skor ~ Zaman, paired = TRUE)
## # A tibble: 1 × 7
## .y. group1 group2 effsize n1 n2 magnitude
## * <chr> <chr> <chr> <dbl> <int> <int> <ord>
## 1 Skor Once Sonra 0.817 15 15 large
ggplot(veri_uzun, aes(x = Zaman, y = Skor, fill = Zaman)) +
geom_boxplot() +
theme_minimal()
