Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Latent variable score

    Dear Stata users,

    could someone tell me how to estimate the latent variable score for a first-order indicative construct? This score will later be used for PLS SEM. Any help on this would be greatly appreciated.

    Thank you and best wishes
    Simona

  • #2
    Simona,

    I'm not familiar with the your terminology. Posting your intended commands would help. Most generally, you probably want the predict post-estimation command with the latent option. With just one latent variable, you can just type

    Code:
    predict, latent
    Otherwise, you can tell it to predict specific latent variables.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      Dear Weiwen,

      thanks for your response! It's much appreciated. Please bear with me, I'm fairly new to Stata. I don't have any relevant code to share. So I'll try my best to specify this way.

      My goal is to use the plssem package (1) to analyse my data. My model features a relationship as shown between y2 and y3 (1). From what I've understood, I need to determine the latent variable score for y2 and then use it as an indicator for y3.

      Click image for larger version

Name:	Venturini &amp; Mehmetoglu.PNG
Views:	1
Size:	23.5 KB
ID:	1543262


      How could I use the predict latent command to determine the latent variable score for y2?

      Best
      Simona

      (1) Venturini, S., & Mehmetoglu, M. (2019). plssem: A Stata Package for Structural Equation Modeling with Partial Least Squares. Journal of Statistical Software, 88(8), 1 - 35. doi:http://dx.doi.org/10.18637/jss.v088.i08

      Comment


      • #4
        Simona,

        plssem (available on SSC) is a new package that I'm not familiar with.

        It does not appear to allow you to predict the latent variable value after estimation, unlike the native Stata sem command. However, from your SEM diagram, you're interested in the relationship between several latent variables. You don't need to predict the values of the latent variables and then regress them. You can estimate the whole set of relationships simultaneously. For sample syntax, you can refer to the example in the manual, starting on page 21.
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment


        • #5
          Dear Weiwen,

          thanks again for your swift reply.

          I was under the impression, that for models, that include formative and reflective constructs pls should be used. Is the sem command also suitable in such cases?

          Is the manual you're refering to the following: https://www.stata.com/manuals13/sem.pdf ?

          In the mean time I tried using the predict command as you suggested, but am unsure if I did correctly.

          Code:
          sem (doi_1 - doi_6 &lt;- IDDOI)
          predict fac_score_IDDOI, latent(IDDOI)
          doi_1 - doi_6 are x4 to x6 in the diagram. IDDOI is y2 fac_score_IDDOI should be the latent factor score I could use for further calculation. Is this correct?

          Best wishes
          Simona

          Comment


          • #6
            Originally posted by Simona Schamper View Post
            Dear Weiwen,

            thanks again for your swift reply.

            I was under the impression, that for models, that include formative and reflective constructs pls should be used. Is the sem command also suitable in such cases?

            Is the manual you're refering to the following: https://www.stata.com/manuals13/sem.pdf ?

            In the mean time I tried using the predict command as you suggested, but am unsure if I did correctly.

            Code:
            sem (doi_1 - doi_6 &lt;- IDDOI)
            predict fac_score_IDDOI, latent(IDDOI)
            doi_1 - doi_6 are x4 to x6 in the diagram. IDDOI is y2 fac_score_IDDOI should be the latent factor score I could use for further calculation. Is this correct?

            Best wishes
            Simona
            Simona,

            I am not an expert in traditional SEM. In fact, I haven't formally learned traditional SEM at all. Thus, I have no idea what formative and reflective constructs are. I have no idea what partial least squares (PLS) is. I have no clue why it's supposed to be theoretically better than the other estimation algorithms available. Nevertheless, Stata's sem command doesn't appear to support PLS estimation. It has maximum likelihood, asymptotic distribution free (I believe this is weighted least squares; it's better for categorical data), maximum likelihood with missing values (I believe this is full-information max likelihood), and quasi-ML (like ML, but some assumptions about the error distribution are relaxed).

            Your code appears to be correct if you want to predict the values of the latent variable y2.

            However, as I mentioned before, I don't believe you need to do this. It seems like you may be trying to separately estimate y1, y2, and y3 through their indicators (e.g. x4-x6), then regress y3 against y1 and y2. I think that the correct thing to do is to fit the entire model simultaneously. That is, you simultaneously estimate y1-y3 through their respective indicators and the relationships among y1-y3. The plssem manual (in the pages I referred to above) should have enough of a code base for you to build off.
            Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

            When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

            Comment


            • #7
              Dear Weiwen,

              thanks again for your reply!

              I agree with what you've said about fitting the model simultaneously. The reason why I need to predict latent scores is, because my actual model (not the example from the manual used for reference here), includes second-order constructs. As I understand it, this requires, latent variables scores to be used as indicators.

              Again - thank you very much for your help!

              Comment


              • #8
                Dear Simona,

                I'm one of the developer of the plssem package. First, let me thank you for your interest in our package.

                PLS-SEM is an alternative approach to the classical SEM and they provide (usually slightly) different answers to the same problems.

                Let me first suggest you to install the package from the following GitHub repository

                https://github.com/sergioventurini/plssem

                where you find the instructions to get the package installed in your local Stata. The GitHub version of the package is the most updated providing solutions to bugs and new features, while SSC does not provide the most recent one.

                To use the 'plssem' command I encourage you to refer to the examples shown in the paper you cited and in the 'plssem' documentation in Stata, that you can get executing the command 'help plssem' in the Stata command window. Unfortunately, not all the features of the package are still very well documented, but we are currently working on a book project where all these features will be fully discussed.

                Nonetheless, to fit the a model with 'plssem' you need to follow a syntax that is similar, although not identical, to that for the 'sem' Stata command. If you hav any more specific question about how to use the package, please contact me directly.

                Best,
                Sergio
                Sergio Venturini

                Comment

                Working...
                X