У меня есть формула ниже:
ANOVAtest <- anova_test(data=Dataovershootwithoutmeans, formula=overshoot~Condition*Distancetodistalboundary+Error(ID/Condition*Distancetodistalboundary), dv=overshoot, wid=ID,within=c(Condition,Distancetodistalboundary),effect.size = "pes")
Ошибка: невозможно подмножество столбцов, которые не существуют. x Столбец Condition
не существует. Запустите rlang::last_error()
, чтобы увидеть, где произошла ошибка.
Хотя в моем фрейме данных четко видно, что есть столбец с именем «Условие»!
Может ли кто-нибудь помочь?
Воспроизводимый набор данных:
library(rstatix)
ANOVAtest <- anova_test(data=Dataovershootwithoutmeans, formula=Stopdistancefromstart~Condition*Distancetodistalboundary+Error(ID/Condition*Distancetodistalboundary), dv=Stopdistancefromstart, wid=ID,within=c(Condition,Distancetodistalboundary),effect.size = "pes")
structure(list(Distancetodistalboundary = c(77.008, 77.008, 77.008,
108.61, 108.61, 108.61, 156.016, 156.016, 156.016, 227.123, 227.123,
333.784, 333.784, 77.008, 77.008, 77.008, 108.61, 108.61, 108.61,
156.016), Condition = c("0", "0.5", "2", "0", "0.5", "2", "0",
"0.5", "2", "0", "0.5", "0", "0.5", "0", "0.5", "2", "0", "0.5",
"2", "0.5"), ID = c("P_200214123342", "P_200214123342", "P_200214123342",
"P_200214123342", "P_200214123342", "P_200214123342", "P_200214123342",
"P_200214123342", "P_200214123342", "P_200214123342", "P_200214123342",
"P_200214123342", "P_200214123342", "P_200217101213", "P_200217101213",
"P_200217101213", "P_200217101213", "P_200217101213", "P_200217101213",
"P_200217101213"), Stopdistancefromstart = c(80.21, 98.661, 98.4568,
114.916, 132.014666666667, 114.558, 175.139, 173.9455, 216.5585,
245.408, 263.881, 360.428, 491.432, 81.4215, 83.917, 91.191,
116.674, 158.305, 116.279, 176.845), overshoot = c(3.202, 21.653,
21.4488, 6.306, 23.4046666666667, 5.94800000000001, 19.123, 17.9295,
60.5425, 18.285, 36.758, 26.644, 157.648, 4.41350000000001, 6.90900000000001, 14.183, 8.06400000000001, 49.695, 7.669, 20.829)), row.names = c(NA, -20L), class = c("tbl_df", "tbl", "data.frame"))