The different results in Lavaan and SmartPLS

857 views
Skip to first unread message

Zhenyang Cai

unread,
Oct 24, 2017, 7:52:43 PM10/24/17
to lav...@googlegroups.com
Hello,

I've conducted an path analysis both in Lavaan and SmartPLS, but the result (path coefficient, fit indices, R square....) is different between lavaan and SmartPLS. I wonder the the reason of the different results.

Thank you for your help
Zhenyang

Edward Rigdon

unread,
Oct 24, 2017, 7:59:20 PM10/24/17
to lav...@googlegroups.com
These packages apply completely different statistical methods. lavaan is a tool for factor-based SEM, while SmartPLS uses a composite-based procedure, partial leat squares path modeling. Differences between the methods are reason enough for a substantial difference in results. However, even if the two packages applied the very same statistical procedure, small differences in algorithms could still produce some differences in results.

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Mauricio Garnier-Villarreal

unread,
Oct 24, 2017, 10:58:18 PM10/24/17
to lavaan
As Edward explains, it is expected to see differences. But, we dont know how different from your example.

But, for the an example, here is code that runs the same model and data with lavaan, and matrixpls, in general the PLS estimates are relatively close to the standardized parameters from lavaan, not the unstandardized

library(lavaan)
library(semTools)
library(matrixpls)


## The industrialization and Political Democracy example
## Bollen (1989), page 332. (Adopted from the lavaan package.)
model <- '
# latent variable definitions
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'

fit1 <- sem(model, data = PoliticalDemocracy, std.lv=T, meanstructure=T)
summary(fit1, fit.measures=T, standardized=T, rsquare=T)
reliability(fit1)


political.out <- matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.optim)
print(political.out)
summary(political.out)
r2(political.out)
fitSummary(political.out)
gof(political.out)
loadings(political.out)
ave(political.out)
cr(political.out)


On Tuesday, October 24, 2017 at 6:59:20 PM UTC-5, Edward Rigdon wrote:
These packages apply completely different statistical methods. lavaan is a tool for factor-based SEM, while SmartPLS uses a composite-based procedure, partial leat squares path modeling. Differences between the methods are reason enough for a substantial difference in results. However, even if the two packages applied the very same statistical procedure, small differences in algorithms could still produce some differences in results.
On Tue, Oct 24, 2017 at 7:52 PM, Zhenyang Cai <zheny...@gmail.com> wrote:
Hello,

I've conducted an path analysis both in Lavaan and SmartPLS, but the result (path coefficient, fit indices, R square....) is different between lavaan and SmartPLS. I wonder the the reason of the different results.

Thank you for your help
Zhenyang

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Mikko Rönkkö

unread,
Oct 25, 2017, 1:51:01 AM10/25/17
to lav...@googlegroups.com
Hi,

A couple of comments to the example. (Disclaimer: I am the developer of of matrixpls)

On 25 Oct 2017, at 5.58, Mauricio Garnier-Villarreal <mauga...@gmail.com> wrote:

As Edward explains, it is expected to see differences. But, we dont know how different from your example.

But, for the an example, here is code that runs the same model and data with lavaan, and matrixpls, in general the PLS estimates are relatively close to the standardized parameters from lavaan, not the unstandardized

No, that does not hold generally. 

What PLS does simply regression with scale scores formed as weighted sums of indicators. If you have indicators where the only source of measurement error is random noise, then the regression coefficients from regression with scale scores typically underestimates the regression paths. This underestimation is a function of reliabilities.

In this example, the results are close to one another because reliabilities are high.

> reliability(fit1)
           ind60     dem60     dem65     total
alpha  0.9023348 0.8587945 0.8827394 0.9149416
omega  0.9437375 0.8375193 0.8556193 0.9134989



library(lavaan)
library(semTools)
library(matrixpls)


## The industrialization and Political Democracy example
## Bollen (1989), page 332. (Adopted from the lavaan package.)
model <- '
# latent variable definitions
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'

fit1 <- sem(model, data = PoliticalDemocracy, std.lv=T, meanstructure=T)
summary(fit1, fit.measures=T, standardized=T, rsquare=T)
reliability(fit1)


political.out <- matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.optim)


This code does not calculate the scale scores using PLS weights, but instead applies numerical optimization (by default BFGS) to maximize or minimize an optimization criterion. The default criterion is to maximize the R2 of the regression between the scale scores, but I have also implemented other criteria and it is easy to implement your own.

When the data are very reliable, then indicator weighting does not matter much. You can check this by comparing all the indicator weight systems implemented in matrixpls:

cbind(matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.optim),
      matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.fixed),
      matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.pls),
      matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.principal),
      matrixpls(cov(PoliticalDemocracy),model, weightFun = weightFun.factor))

They all produce nearly identical results.

                   [,1]      [,2]      [,3]      [,4]      [,5]
dem60~ind60  0.46193397 0.3931697 0.4027185 0.3962893 0.4252621
dem65~ind60  0.19440196 0.2004695 0.1960200 0.1964309 0.1710589
dem65~dem60  0.77472958 0.7823229 0.7858439 0.7844442 0.7860951

Note that PLS weights have important problems that you should be aware of. See for example here:


I am pretty sure that all the problems of PLS weights apply also if you optimize the weights to maximize R2, but I do not think that anyone has studied this.

Mikko
Reply all
Reply to author
Forward
0 new messages