Hi everyone,
I'm trying to estimate a latent class logit model (exactly the one as described in the lclogit package) using a finite mixture model either through gsem or fmm.
I am unsure what the syntax is to tell the estimation that some observations belong to the same individual, and hence, they should be assigned the same latent class.
Here's an example:
The response variable y is binary. The predictor is x, and the some persons may have multiple observations.
(This is not the real data, it is simplified).
I was trying the following syntax:
But adding the the [person] part does not seem to impact the estimation, it gets the same result as:
With fmm, I am not even sure how to include this constraint on the latent variable.
Any idea how this should be operationalized?
Thanks,
- Ron
I'm trying to estimate a latent class logit model (exactly the one as described in the lclogit package) using a finite mixture model either through gsem or fmm.
I am unsure what the syntax is to tell the estimation that some observations belong to the same individual, and hence, they should be assigned the same latent class.
Here's an example:
Code:
person y x 1 0 12 1 1 13 2 0 14 2 1 12 2 0 15
The response variable y is binary. The predictor is x, and the some persons may have multiple observations.
(This is not the real data, it is simplified).
I was trying the following syntax:
Code:
gsem (1: y <- x) (2: y <-) (C[person] <- ),logit latent(C) lclass(C 2)
Code:
gsem (1: y <- x) (2: y <-) (C <- ),logit latent(C) lclass(C 2)
Any idea how this should be operationalized?
Thanks,
- Ron
Comment