tests/testthat/test_multilevel_random_slope.R

devtools::load_all()

syntax <- "
  X =~ x1 + x2 + x3
  Z =~ z1 + z2 + z3
  Y =~ y1 + y2 + y3
  W =~ w1 + w2 + w3
  Y ~ X + Z + (1 + X + Z | cluster)
  W ~ X + Z + (1 + X + Z | cluster)
"

fit.c <- pls(syntax, data = randomSlopes,
           consistent = TRUE, bootstrap = TRUE)
summary(fit.c)


syntax <- "
  X =~ x1 + x2 + x3
  Z =~ z1 + z2 + z3
  Y =~ y1 + y2 + y3
  W =~ w1 + w2 + w3
  Y ~ X + Z + (1 + X + Z | cluster)
  W ~ X + Z + (1 + X + Z | cluster)
"

fit.o <- pls(syntax, data = randomSlopesOrdered,
           consistent = TRUE, bootstrap = TRUE)
summary(fit.o)

Try the plssem package in your browser

Any scripts or data that you put into this service are public.

plssem documentation built on March 23, 2026, 5:08 p.m.