Announcement

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

  • Equality constraints for lclogit

    I'm building a latent class model with 2 classes from survey data.
    I would like to put equality constraints so that some coefficients of Class 1 are constrained to be equal to the coefficients of Class 2 but I'm a bit confused about the correct syntax..
    Examples in help files are all about constraints to a specific value rather equalities between classes..

    Any suggestion would be much appreciated.

    Matteo

  • #2
    Hi Corsi, have you solved the problem?

    Comment


    • #3
      Maybe you should start with - gsem - approach, using the option - lcinvariant() for that matter. Below, a description from the Stata Manual:



      gsem can fit models with categorical latent variables having specified numbers of latent classes.
      Some parameters can vary across classes while others are constrained to be equal across classes.
      gsem performs such estimation when the lclass() option is specified. The lcinvari-
      ant(pclassname) option specifies which parameters are to be constrained to be equal across the latent
      classes.
      Best regards,

      Marcos

      Comment


      • #4
        Hi statalist,

        I don't know if someone is interested again but I found a solution when I was reading the lclogit2 paper written by Yoo (2019). In the Stata help file, you can read:

        Code:
        * Repeat the first example under two constraints: 1) class 1 and class 3 have the same coefficient on contract, and 2) in class 2, the coefficient on local takes the value of 0.
        
        constraint 1 [Class1]contract = [Class3]contract
        constraint 2 [Class2]local = 0
        lclogit2 y, rand(price contract local wknown tod seasonal) id(pid) group(gid) nclasses(4) constraints(1 2)
        matrix start = e(b)
        lclogitml2 y, rand(price contract local wknown tod seasonal) id(pid) group(gid) nclasses(4) constraints(1 2) from(start)
        Hope it would help !

        Gabin.

        Comment

        Working...
        X