> # ============================================================ > # Pre-task_Grammar_Instruction_LREs_Young_Learners – Table 3 > # Wilcoxon Rank-sum tests (Control vs Experimental) > # per dictogloss task (1, 2, and 1+2) and target feature > # ============================================================ > library(readxl) > library(dplyr) > library(rstatix) > # ---- Load the Excel file ---- > data_path <- "C:/Users/dmard/Documents/PTGI_LRE_repro_package/data/PTGI_LRE_data_1.xlsx" > # Dictogloss 1 > d1 <- read_excel(data_path, sheet = "Dict. 1") > # Dictogloss 2 > d2 <- read_excel(data_path, sheet = "Dict. 2") > # Combined totals (D1 + D2) > d_tot <- read_excel(data_path, sheet = "D1+D2+IDs") > # ---- Check group variable ---- > d1 <- d1 %>% mutate(Group = as.factor(Group)) > d2 <- d2 %>% mutate(Group = as.factor(Group)) > d_tot <- d_tot %>% mutate(Group = as.factor(Group)) > # ============================================================ > # WILCOXON RANK-SUM TESTS > # ============================================================ > cat("\n==============================\nDICTOGLOSS 1\n==============================\n") ============================== DICTOGLOSS 1 ============================== > cat("\nHE/SHE\n") HE/SHE > print(wilcox.test(`HE/SHE_D1_SUM` ~ Group, data = d1, alternative = "two.sided", exact = FALSE, correct = TRUE)) Wilcoxon rank sum test with continuity correction data: HE/SHE_D1_SUM by Group W = 13.5, p-value = 0.9081 alternative hypothesis: true location shift is not equal to 0 > cat("\n3ps -s\n") 3ps -s > print(wilcox.test(`3ps_D1_SUM` ~ Group, data = d1, alternative = "two.sided", exact = FALSE, correct = TRUE)) Wilcoxon rank sum test with continuity correction data: 3ps_D1_SUM by Group W = 8.5, p-value = 0.4065 alternative hypothesis: true location shift is not equal to 0 > cat("\n==============================\nDICTOGLOSS 2\n==============================\n") ============================== DICTOGLOSS 2 ============================== > cat("\nHE/SHE\n") HE/SHE > print(wilcox.test(`HE/SHE_D2_SUM` ~ Group, data = d2, alternative = "two.sided", exact = FALSE, correct = TRUE)) Wilcoxon rank sum test with continuity correction data: HE/SHE_D2_SUM by Group W = 15.5, p-value = 0.5775 alternative hypothesis: true location shift is not equal to 0 > cat("\n3ps -s\n") 3ps -s > print(wilcox.test(`3ps_D2_SUM` ~ Group, data = d2, alternative = "two.sided", exact = FALSE, correct = TRUE)) Wilcoxon rank sum test with continuity correction data: 3ps_D2_SUM by Group W = 19.5, p-value = 0.1475 alternative hypothesis: true location shift is not equal to 0 > cat("\n==============================\nDICTOGLOSS 1 + 2 (TOTAL)\n==============================\n") ============================== DICTOGLOSS 1 + 2 (TOTAL) ============================== > cat("\nHE/SHE\n") HE/SHE > print(wilcox.test(`HE/SHE_SUM` ~ Group, data = d_tot, alternative = "two.sided", exact = FALSE, correct = TRUE)) Wilcoxon rank sum test with continuity correction data: HE/SHE_SUM by Group W = 16, p-value = 0.5179 alternative hypothesis: true location shift is not equal to 0 > cat("\n3ps -s\n") 3ps -s > print(wilcox.test(`3ps_SUM` ~ Group, data = d_tot, alternative = "two.sided", exact = FALSE, correct = TRUE)) Wilcoxon rank sum test with continuity correction data: 3ps_SUM by Group W = 13.5, p-value = 0.906 alternative hypothesis: true location shift is not equal to 0 > # ============================================================ > # END OF ANALYSES > # ============================================================ > cat("\nAll Wilcoxon tests for Table 3 completed successfully.\n") All Wilcoxon tests for Table 3 completed successfully.