I have a matched paired dataset (student survey before a topic was taught and student survey after the same topic was taught) where I compare the means of their answers (answers are given in Likert scales).
I use the Wilcoxon signed rank test (as opposed to the rank sum test) to compare scores of individual questions to see if they are significant, where my code is
wilcox.test(score ~ time, data = "question 1", paired = TRUE)
I want to test and see if let's say previous experience in the topic was a contributing variable in creating a significant jump in mean from before to after in a group of questions (etc. questions 1-4). But I am stuck on which method of analysis to use in this situation.
I initially used a Kruskal Wallis test, then performed a post hoc Dunn test with Bonferroni adjustment, which gave results such as "test scores of students with no previous experience in a topic were significant from before to after" and "test scores of students with previous experience in a topic were not significant from before to after". But I realized K-W is only appropriate when the variables are independent. So my question is, are my variables dependent because the students are from the same sample and the data are matched this way, or are they independent because my matched data is being compared to previous experience which is an independent variable?