Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
rstatix方差分析检验的未解释错误_R - Fatal编程技术网

rstatix方差分析检验的未解释错误

rstatix方差分析检验的未解释错误,r,R,我无法使用包rstatix运行重复测量方差分析。 我想进行重复测量方差分析,来自两个治疗组的患者在两个不同的时间点报告结果 anova_test(data = test1, dv = outcome, wid = id, within = c(group, time)) 但是,尽管数据集中没有丢失的数据,但还是出现了一个错误 lm.拟合误差(x,y,偏移=偏移,singular.ok=singular.ok,…) :0(非NA)例 我将非常感谢任何帮助!谢谢 数据: 您尚未指定公式,因此它不知

我无法使用包rstatix运行重复测量方差分析。 我想进行重复测量方差分析,来自两个治疗组的患者在两个不同的时间点报告结果

anova_test(data = test1, dv = outcome, wid = id, within = c(group, time))
但是,尽管数据集中没有丢失的数据,但还是出现了一个错误

lm.拟合误差(x,y,偏移=偏移,singular.ok=singular.ok,…) :0(非NA)例

我将非常感谢任何帮助!谢谢

数据:


您尚未指定公式,因此它不知道要运行哪个测试。尝试添加
formula=outcome~group*time

所以代码是这样写的

rstatix::anova_test(data = test1, formula = outcome ~ group*time, 
dv = outcome, 
wid = id2, 
within = c(group, time))

ANOVA Table (type II tests)

      Effect DFn  DFd       F        p p<.05      ges
1      group   1 1286   0.806 3.70e-01       0.000626
2       time   1 1286 303.565 3.35e-61     * 0.191000
3 group:time   1 1286   0.309 5.78e-01       0.000240
rstatix::anova_检验(数据=测试1,公式=结果~组*时间,
dv=结果,
wid=id2,
内=c(组,时间))
方差分析表(II型试验)
效果DFn DFd F p pF)
第10.3组10.3 1 643 0.5613 0.4540
时间9846.79846.71643538.0482
rstatix::anova_test(data = test1, formula = outcome ~ group*time, 
dv = outcome, 
wid = id2, 
within = c(group, time))

ANOVA Table (type II tests)

      Effect DFn  DFd       F        p p<.05      ges
1      group   1 1286   0.806 3.70e-01       0.000626
2       time   1 1286 303.565 3.35e-61     * 0.191000
3 group:time   1 1286   0.309 5.78e-01       0.000240
devtools::install_github("easystats/report")
library(report)
install.packages("lmerTest")
library(lmerTest)
fit <- lmer(outcome ~ group*time + (1|id), data=test1)
anova(fit)
report(fit)
Type III Analysis of Variance Table with Satterthwaite's method
           Sum Sq Mean Sq NumDF DenDF  F value Pr(>F)    
group        10.3    10.3     1   643   0.5613 0.4540    
time       9846.7  9846.7     1   643 538.0482 <2e-16 ***
group:time   10.0    10.0     1   643   0.5474 0.4597    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1