The goal of the plssem package is to allow the estimation of complex Structural Equation Models (SEMs) using the PLS-SEM framework. This package expands the PLS-SEM (and PLSc-SEM) framework to handle categorical data, non-linear models, and multilevel structures, using Monte-Carlo Consistent Partial Least Squares Structural Equation Modelling (MC-PLSc-SEM)

plssem is currently under development. The end goal is to allow the consistent estimation of non-linear multilevel SEMs with ordinal and categorical data, using the MC-PLSc-SEM framework.

Installation

The package can be downloaded from CRAN.

The development version of the package can be installed from GitHub.

devtools::install_github("kss2k/plssem")

Examples

Linear Model with Continuous Data

library(plssem)
library(modsem)

tpb <- '
# Outer Model (Based on Hagger et al., 2007)
  ATT =~ att1 + att2 + att3 + att4 + att5
  SN =~ sn1 + sn2
  PBC =~ pbc1 + pbc2 + pbc3
  INT =~ int1 + int2 + int3
  BEH =~ b1 + b2

# Inner Model (Based on Steinmetz et al., 2011)
  INT ~ ATT + SN + PBC
  BEH ~ INT + PBC
'

fit <- pls(tpb, TPB, bootstrap = TRUE)
summary(fit)

Linear Model with Ordered Data

tpb <- '
# Outer Model (Based on Hagger et al., 2007)
  ATT =~ att1 + att2 + att3 + att4 + att5
  SN =~ sn1 + sn2
  PBC =~ pbc1 + pbc2 + pbc3
  INT =~ int1 + int2 + int3
  BEH =~ b1 + b2

# Inner Model (Based on Steinmetz et al., 2011)
  INT ~ ATT + SN + PBC
  BEH ~ INT + PBC
'

fit <- pls(tpb, TPB_Ordered, bootstrap = TRUE)
summary(fit)

Multilevel Model with Continuous Data

syntax <- '
  level: 1
    fw =~ y1 + y2 + y3
    fw ~ x1 + x2 + x3
  level: 2
    fb =~ y1 + y2 + y3
    fb ~ w1 + w2
'

fit <- pls(syntax, data = randomSlopes, cluster = "cluster", bootstrap = TRUE)
summary(fit)

Multilevel Model with Ordered Data

syntax <- '
  level: 1
    fw =~ y1 + y2 + y3
    fw ~ x1 + x2 + x3
  level: 2
    fb =~ y1 + y2 + y3
    fb ~ w1 + w2
'

fit <- pls(syntax, data = randomSlopesOrdered, cluster = "cluster", bootstrap = TRUE)
summary(fit)

Multilevel Random Slopes Model with Continuous Data

syntax <- '
  level: 1
    fw =~ y1 + y2 + y3
    fw ~ rv("s1")*x1 + rv("s2")*x2 + x3
  level: 2
    fb =~ y1 + y2 + y3
    fb ~ w1 + w2
    # the random slopes are latent variables at the between level
    s1 + s2 ~ w1 + w2
'

fit <- pls(syntax, data = randomSlopes, cluster = "cluster", bootstrap = TRUE)
summary(fit)

Multilevel Random Slopes Model with Ordered Data

syntax <- '
  level: 1
    fw =~ y1 + y2 + y3
    fw ~ rv("s1")*x1 + rv("s2")*x2 + x3
  level: 2
    fb =~ y1 + y2 + y3
    fb ~ w1 + w2
    # the random slopes are latent variables at the between level
    s1 + s2 ~ w1 + w2
'

fit <- pls(syntax, data = randomSlopesOrdered, cluster = "cluster", bootstrap = TRUE)
summary(fit)

Interaction Model with Continuous Data

m <- '
  X =~ x1 + x2 + x3
  Z =~ z1 + z2 + z3
  Y =~ y1 + y2 + y3

  Y ~ X + Z + X:Z
'

fit <- pls(m, modsem::oneInt, bootstrap = TRUE)
summary(fit)

Interaction Model with Ordered Data

m <- '
  X =~ x1 + x2 + x3
  Z =~ z1 + z2 + z3
  Y =~ y1 + y2 + y3

  Y ~ X + Z + X:Z
'

fit <- pls(m, oneIntOrdered, bootstrap = TRUE)
summary(fit)