我的数据:
Q5 Q6 Q7
1 Not Agree Neutral Not Agree
2 Not Agree Neutral Neutral
3 Not Agree Agree Agree
4 Not Agree Agree Neutral
5 Neutral Not Agree Neutral
6 Not Agree Agree Neutral
7 Not Agree Neutral Neutral
8 Neutral Agree Neutral
9 Agree Neutral Not Agree
10 Neutral Agree Neutral
Q567[1:3] <- lapply(Q567[1:3], factor, levels= c("Agree", "Neutral", "Not Agree"), ordered = TRUE)
likert(Q567) %>%
plot(type = "bar")
我已经将它们转换为具有级别的因子,但为什么我仍然会收到错误提示?
Error in likert(Q567) : All items (columns) must have the same number of levels
dput(yourdata)
的输出。我们无法从图片中复制/粘贴数据,也无法了解其结构。 - neilfws