everybody! I have a data in the following format
df <- data.frame(id = c(1, 1, 2, 2),
time = c("pre", "post", "pre", "post"),
type = rep(c("ctrl", "exp"), each =2),
values = c(61.39881, 49.01473, 31.69452, 32.19900))
And I am not able to run an Sphericity test for my ANOVA repeated measures analysis with the following code
library(rstatix)
res.aov <- anova_test(data = df, dv = values, wid = id, within = c(type, time))
The error I get is Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases But I have no NA and a total of 848 subjects
Can someone help me, please? Thanks!
I believe the
typevariable should be a between-sample variable rather than within-sample. Unless you get the sample individual for both the control and experimental intervention.Therefore, you should do:
If you really perform both interventions to the same individual, then it should not get you an error: