最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

r - Repeated-measures ANOVA in WRS2 in SPSS returns p-value & F-statistic as NA - Stack Overflow

programmeradmin2浏览0评论

I am calculating a one-way repeated measures ANOVA using the WRS2 package in SPSS 29. To do that I installed the WRS2 package and tidyr package using the following code:

Begin Program R.
install.packages ("WRS2", repos = ";)
End Program.

Begin Program R.
library(WRS2)
End Program.

Begin Program R.
install.packages ("tidyr")
End Program.

Begin Program R.
library(tidyr)
End Program.

Begin Program R.
mySPSSdata = spssdata.GetDataFromSPSS (factorMode = "labels")
id <- "ID_A"
rm_factor <- c("M_PHQ9_t0", "M_PHQ9_t1", "M_PHQ9_t2")
df <- pivot_longer(mySPSSdata, cols = all_of(rm_factor), names_to = "variable", values_to = "value")
names (df) [names (df) == id] <- "id"
rmanova (df$value, df$variable, df$id, tr = 0.2)
rmmcp (df$value, df$variable, df$id, tr = 0.2)

I can´t share the data, but the sample size is around 27. My problem is that, the output of the ANOVA is strange, it returns the p-value and F-statistic as NA and I don´t know what the problem is. I thought maybe the sample was too small and set trim to 0, which only leads to p & F being NaN. I would very much appreciate any help!!

The Output is:

Call:
rmanova(y = df$value, groups = df$variable, blocks = df$id, tr = 0)
Test statistic: F = NaN
Degrees of freedom 1: 1.46
Degrees of freedom 2: 67.33
p-value: NaN
Call:
rmmcp(y = df$value, groups = df$variable, blocks = df$id, tr = 0)
                         psihat ci.lower ci.upper p.value p.crit   sig
M_PHQ9_t0 vs. M_PHQ9_t1 1.28175 -0.13962  2.70311 0.02964 0.0169 FALSE
M_PHQ9_t0 vs. M_PHQ9_t2 1.47619 -0.23572  3.18810 0.03702 0.0250 FALSE
M_PHQ9_t1 vs. M_PHQ9_t2 0.19444 -0.80647  1.19536 0.62825 0.0500 FALSE
发布评论

评论列表(0)

  1. 暂无评论