Announcement

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

  • Latent class analysis

    Hi ! After having launched LCA, how can be estimated the probability of a single observation to belong to one specific class? I have run a 3-class model based on lowest BIC values
    I have found some commands online , but it seems doesn't work and seems to fit all the observations within the same class.

    thanks

  • #2
    You will find information in Example 50g for SEM-models:

    Code:
    clear
    use https://www.stata-press.com/data/r18/gsem_lca1
    gsem (accident play insurance stock <- ), logit lclass(C 2)
    predict classpost*, classposteriorpr
    The predict command will produce probability of class membership

    Comment


    • #3
      thank you for your help. However this is the overall probability .

      I was saying if there is a command to say: subject#1 belongs to class 1, subject #2 belongs to class 3, subject #3 to class 2....etc.....

      thanks
      Last edited by Marco Masetti; 19 Feb 2025, 08:31.

      Comment


      • #4
        Originally posted by Marco Masetti View Post
        thank you for your help. However this is the overall probability .

        I was saying if there is a command to say: subject#1 belongs to class 1, subject #2 belongs to class 3, subject #3 to class 2....etc.....

        thanks
        The code from #2 gives - according to https://www.stata.com/manuals/semexample50g.pdf - the "predictions of the posterior probability of class membership to evaluate an individual’s probability of being in each class."

        Thus, the predict command generates, for each respondent, the probability for being in each class. The sum of the predicted probabilities sum to 1.

        Note that all respondents with identical responses have identical probability for being in all classes.

        Comment


        • #5
          You won’t get precisely the answer you want because there is a posterior probability to belong to each latent class for each individual. This is what the model is estimating. The most likely membership will be the class with the highest posterior probability.

          Comment

          Working...
          X