【问题标题】:Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases in repeated measures ANOVAlm.fit(x,y,offset = offset,singular.ok =singular.ok,...)中的错误:重复测量方差分析中的 0(非 NA)案例
【发布时间】:2020-08-20 20:08:18
【问题描述】:

我不断收到相同的错误,尝试使用 rstatix 包中的 anova_test 进行单向重复测量方差分析。这是我的数据 https://github.com/gyrusrectus/stackquery/blob/master/s2.csv 和代码

anova_test(data=s2, dv = mean_score, wid = id, within = station)

我想比较三个不同任务站的候选人的平均分数。请帮忙。

【问题讨论】:

    标签: r anova


    【解决方案1】:

    这似乎是anova_test 中的一个错误。如果您的数据框包含模型中没有的变量,则会引发错误。如果你放弃它们,它会按预期工作:

    s2 <- read.csv("https://raw.githubusercontent.com/gyrusrectus/stackquery/master/s2.csv")
    s2 <- s2[,c(1, 2, 7)]
    
    anova_test(data = s2, dv = mean_score, wid = cand_id, within = station)
    #> 
    #> ANOVA Table (type III tests)
    #> 
    #> $ANOVA
    #>    Effect DFn DFd   F        p p<.05   ges
    #> 1 station   2  42 8.8 0.000643     * 0.157
    #> 
    #> $`Mauchly's Test for Sphericity`
    #>    Effect     W     p p<.05
    #> 1 station 0.859 0.219      
    #> 
    #> $`Sphericity Corrections`
    #>    Effect   GGe      DF[GG] p[GG] p[GG]<.05  HFe     DF[HF]    p[HF] p[HF]<.05
    #> 1 station 0.876 1.75, 36.81 0.001         * 0.95 1.9, 39.89 0.000819         *
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-12
      • 1970-01-01
      • 2013-04-20
      • 2020-09-09
      • 1970-01-01
      • 2018-09-26
      • 2020-08-23
      • 2017-09-26
      相关资源
      最近更新 更多