FloSchuberth / cSEM

Composite-based SEM
https://floschuberth.github.io/cSEM/
GNU General Public License v3.0
28 stars 7 forks source link

Fixed effects syntax in CSEM #461

Closed grlju closed 2 years ago

grlju commented 2 years ago

Hi Florian,

I am trying to implement a fixed effect using CSEM.

Since I am relatively new to SEM modelling, I am letting myself be guided by this document: https://github.com/henrik-andersen/random-fixed-effects-sem/blob/main/article/random-fixed-effects-sem.pdf

The issue that I am facing is that for this to work, coefficients need to be constrained to be equal over the fixed effect and, ideally, individual effects covary with covariates and residual variances should also be set equal over the fixed effect.

The paper I linked provides a laavan syntax for implementing this (see page 10).

fe_sem <- '
# Define individual effects variable
alpha =~ 1*y1 + 1*y2 + 1*y3 + 1*y4
# Regressions, constrain coefficient to be equal over time
y1 ~ beta*x1 + gamma*z
y2 ~ beta*x2 + gamma*z
y3 ~ beta*x3 + gamma*z
y4 ~ beta*x4 + gamma*z
# Correlations, individual effects covary with the covariate
alpha ~~ x1 + x2 + x3 + x4 + 0*z
x1 ~~ x2 + x3 + x4 + z
x2 ~~ x3 + x4 + z
x3 ~~ x4 + z
x4 ~~ z
# Constrain residual variances to be equal over time
y1 ~~ nu*y1
y2 ~~ nu*y2
y3 ~~ nu*y3
y4 ~~ nu*y4
'

Given that CSEM does not allow the following laavan syntax: y1 ~ beta*x1 + gamma*z, do you have any pointers about how something similar could be implemented in CSEM?

Thank you very much.

FloSchuberth commented 2 years ago

Dear @grlju,

unfortunately it is not possible the estimate fixed effects with PLS-PM (at least nobody has thought of how to do that in PLS-PM), which is the main estimator in cSEM. In general, it is currently not possible to fix parameters in cSEM. However, considering the mentioned pdf, you should be able to do that in lavaan. Note we use the lavaan syntax to specify models in cSEM, but cSEM differs strongly from lavaan how model parameters are estimated. In lavaan, typically an ML estimator is used while in cSEM PLS-PM is used...

Best regards, Florian

grlju commented 2 years ago

Dear Florian,

Thanks a lot for the quick response. I am aware of the main differences between PLS PM and covariance-based SEM (but still learning about the finer points of difference). For my current analysis, I think the former is more appropriate. This is why I asked the question. I guess I can always double-check for fixed effects with laavan, and the only trouble is that if results differ, it is not clear if it is due to the fixed effect or the different estimation techniques.

Do you think it is possible to include dummy variables, as is often done in OLS?

Would a code like this make sense or do you think this is not a valid approach in PLS PM?

dummy_sem <- '
# Structural
dv ~ y1 + y2 + y3 + y4

# Composite model
y1 <~ x1
y2 <~ x2
y3 <~ x3
y4 <~ x4

# Correlations, individual effects covary with the covariate
dv ~~ x1 + x2 + x3 + x4
x1 ~~ x2 + x3 + x4
x2 ~~ x3 + x4
x3 ~~ x4
'

Thanks again for your work on this package.

Kind regards, Greg

FloSchuberth commented 2 years ago

Dear @grlju

In fact, in its original form, PLS-PM is OLS regression with weighted composite scores. So there is no problem to include dummy variables as independent variables in your model as you do in OLS regression models. As you correctly did, you need to model observed variables that you want to include in your structural model as single-indicator constructs. Hereby, it does not matter whether you define the construct as common factor (=~) or composite (<~).

This following lines surprised me:

Correlations, individual effects covary with the covariate

dv ~~ x1 + x2 + x3 + x4 x1 ~~ x2 + x3 + x4 x2 ~~ x3 + x4 x3 ~~ x4

To me it is not really clear what do you want to model here. Anyways. in cSEM the ~~ command is almost always ignored except when you specify correlations among measurement errors within a block of indicators. In traditional PLS-PM, it is not possible to fix or free correlations certain correlations and you need to go with PLS-PM's default assumptions, e.g., independent variables of one equation are always allowed to be correlated. Hence, I recommend to remove these lines.

In general, why do you think PLS-PM is more appropriate (not that I don't like PLS-PM, I am just curious)? If you want to model composites, this can also be done in CB-SEM, see Schuberth (in press). Another helpful paper to decide about PLS-PM is Rigdon (2016). If you don't have access to these papers, please send me an email. I can share a copy with you.

HTH

Best regards, Florian

References: E. E. Rigdon, “Choosing PLS path modeling as analytical method in European management research: A realist perspective,” European Management Journal, vol. 34, no. 6, Art. no. 6, 2016.

F. Schuberth, “The Henseler-Ogasawara specification of composites in structural equation modeling: A tutorial,” Psychological Methods, in press.

grlju commented 2 years ago

Hi Florian,

Thanks a lot for the quick response and apologies for taking so long to get to this.

Yes, that helps. I was just thinking of telling the model that the indicators are correlated but since that is always the case, this does not seem to be necessary. So I will omit this.

Thank you also for sharing these references, I have read them and found them very insightful. My main reason for favouring PLS-PM in this analysis was that I believe that my constructs consist of a linear combination of observables so I am trying to model concepts as composites.

Thanks again for your help on this.

Kind regards, Greg

FloSchuberth commented 2 years ago

Dear Greg,

the problem with dv ~~ x1 + x2 + x3 + x4 x1 ~~ x2 + x3 + x4 x2 ~~ x3 + x4 x3 ~~ x4

is that you would allow correlations between the observed variables past the composites. Which violates the assumption of the composite model, namely that all information between the variables forming a composite and other variables is conveyed by the composite, see Dijkstra (2017).

Something like this would be more reasonable: y1 ~~ y2 + y3 + y4 y2 ~~ y3 + y4 y3 ~~ y4

However, as mentioned before, this is automatically done because in PLS all independent variables are allowed to be correlated.

Best regards, Florian

T. K. Dijkstra, “A perfect match between a model and a mode,” in Partial Least Squares Path Modeling: Basic Concepts, Methodological Issues and Applications, Ed.H. Latan and R. Noonan Cham: Springer, 2017, pp. 55–80.