【问题标题】:Replace x-axis from a mixed-model plot从混合模型图中替换 x 轴
【发布时间】:2021-04-27 22:20:36
【问题描述】:

在下面的情节中,我想知道是否可以将grade 作为 x 轴?

multivariate <- read.csv('https://raw.githubusercontent.com/hkil/m/master/bv.csv')

library(nlme)
library(effects) # for plot

m2 <- lme(var ~ 0 + d_math + d_hyp + d_math:I(grade-2) + d_hyp:I(grade-2),
          random = ~ 0 + d_math + d_hyp + d_math:I(grade-2) + d_hyp:I(grade-2) | id, data = multivariate,
          na.action = na.omit, weights = varIdent(c(hyp=.3), form = ~1|grp),
          control = lmeControl(maxIter = 200, msMaxIter = 200, niterEM = 50,
                               msMaxEval = 400))

plot(allEffects(m2), multiline = TRUE)

【问题讨论】:

    标签: r regression lme4 mixed-models nlme


    【解决方案1】:

    应该这样做:

    plot(allEffects(m2), x.var="grade", multiline = TRUE)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-09-26
      • 1970-01-01
      • 2021-04-02
      • 2020-11-17
      • 2023-02-07
      • 2017-10-07
      • 2021-10-05
      相关资源
      最近更新 更多