jasp-issues
jasp-issues copied to clipboard
[Feature Request]: Save scores of latent variables on CFA and SEM (both CB & PLS)
Description
The two-step approach for a higher-order construct (HOC) implies a saturated model, a mesaurement model assessment and save scores of latent variables to be used as indicators for the HOC
Purpose
Enable users to model HOC models
Use-case
Any model that is based on HOC
Is your feature request related to a problem?
Not a problem, but a lack of option
Is your feature request related to a JASP module?
SEM
Describe the solution you would like
An option to save scores as new variables, using the name of each latent variable on the saturated model
Describe alternatives that you have considered
when using cSEM in R I can export the scores, but this is not CB-SEM
Additional context
No response
related: https://github.com/jasp-stats/jasp-issues/issues/101
@FloSchuberth do you think this has some merit?
@juliuspfadt: In general, I would say it depends on the JASP infrastructure and how easy it is to attach new variables to the dataset. For example, is it possible to save the residuals of a regression analysis as a new variable? If this is not problem, calculating the construct scores for PLS/SEM/CFA/EFA is not a problem.
To get the construct scores in cSEM (i.e., PLS), you can use the getConstructScores function (set the standardized argument to TRUE). In this way, construct scores are calculated using the PLS weights of the user specified model. So if the user wants to have a saturated structural model because they want to perform the two-stage approach, they need to specify this model manually and calculate the construct scores for this model. Subsequently, they can save the construct scores and use them in the second-stage. Btw, we have implemented the two-/and three-stage approaches mentioned by the issue creator in cSEM. Might be sth. for the future.
Considering classical SEM, it is not necessary to have the construct scores to estimate a model containing higher-order constructs. In SEM, the higher-order construct and its relationships with the first-order constructs are part of the structural model, i.e., the B matrix. So there is not much of a difference to a model that contains no second-order constructs (at least from an estimation perspective). For PLS, this is different because a model containing a second-order construct cannot be estimated by default as the second-order construct has no indicators, which are required in PLS, i.e,. each construct needs to have indicators. Therefore, various approaches have been proposed, see e.g., Schuberth et al (2020; 10.1108/IMDS-12-2019-0642) for an overview. One of them is the two-stage approach mentioned by the issue creator. I spare you the details. If you are interested you can read Schuberth et al. (2020) and Van Riel et al., (2017; https://doi.org/10.1108/IMDS-07-2016-0286). Yet, it might be interesting to get the construct scores for CFA/SEM. Various ways have been proposed to calculate them. You can use the predict function of the lavaan package.
To get scores in an EFA, you can use the psych package, which offers the factor.scores function.
So to conclude, getting the scores is not a big issue, the question is rather how difficult it is to attach new variables to the existing datatset.
HTH
Okay. Thank you! I have just implemented the scores for EFA and PCA (https://github.com/jasp-stats/jaspFactor/pull/215). If I understand you correctly, for PLS SEM this would require something like a checkbox "save scores to data"?
Yes, I would do so. If the box is checked, the getConstructScores function is called on the cSEM result object, see also: https://search.r-project.org/CRAN/refmans/cSEM/html/getConstructScores.html As a result, you will get a list where one list element contains a matrix containing the construct scores. If you want to make it fancy, you can also allow that the user can choose between standardized and unstandardized construct scores, see the argument of the getConstructScores function. However, if you want to keep it simple, the standardzied scores should be sufficient.
sounds easy enough. thanks :)
Compared to CFA/EFA, in PLS there is in principle only one way to calculate the scores, i.e., using the PLS weights (in contrast to SEM, where we have various ways to determine the weights and thus the construct scores, like Bartlett, regression etc.). So yes, it should be not that difficult...:)
would you put this under the tab "output" or "prediction"?
Under output, as under prediction we refer to out-of-sample prediction metrics (which has nothing to do with the construct scores)
well, alright. although I am sometimes doubtful how much "out of sample" predictions really predict out of sample. but that is a discussion for another time :)
Haha, looking forward :)
thanks JASP's team, thanks Florian
De: FloSchuberth @.> Enviado: segunda-feira, 6 de maio de 2024 11:36 Para: jasp-stats/jasp-issues @.> Cc: mgabriel-br @.>; Author @.> Assunto: Re: [jasp-stats/jasp-issues] [Feature Request]: Save scores of latent variables on CFA and SEM (both CB & PLS) (Issue #2265)
Haha, looking forward :)
— Reply to this email directly, view it on GitHubhttps://github.com/jasp-stats/jasp-issues/issues/2265#issuecomment-2096190227, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATNT4DVK6DGIW6QQQSFBUM3ZA6IQTAVCNFSM6AAAAAA3UQ4EPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWGE4TAMRSG4. You are receiving this because you authored the thread.Message ID: @.***>