0

In my plot below, I was wondering if I could put grade as x-axis?

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)

enter image description here

rnorouzian
  • 7,397
  • 5
  • 27
  • 72

1 Answers1

0

This should do it:

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

enter image description here

DaveArmstrong
  • 18,377
  • 2
  • 13
  • 25