Hello. I am having trouble estimating simple latent class models, and for my question I am using the simplest model I can.
First, note that I have a variable called Dgiveupbinary that is indeed a categorical variable. I am sure of this because this is its tabulation
. tabulate Dgiveupbinary
Dgiveupbina |
ry | Freq. Percent Cum.
------------+-----------------------------------
0 | 7,809 71.37 71.37
1 | 3,132 28.63 100.00
------------+-----------------------------------
Total | 10,941 100.00
Dgiveupbinary only takes zero or one values.
When I try to run a simple two class latent class model using the following command
. gsem (Dgiveupbinary <- ), logit lclass(C 2)
I get the following error
"
. gsem (Dgiveupbinary <- ), logit lclass(C 2)
option lclass() not allowed;
option lclass() is not allowed with models specified with continuous latent variables
r(198);
"
I don't understand why it believes the variable is not categorical when it is only zeros and ones. I've done some reading and there doesn't seem to be any way that Stata officially labels a variable as continuous or categorical.
Thoughts? Any help is greatly appreciated.
Bailey Norwood
First, note that I have a variable called Dgiveupbinary that is indeed a categorical variable. I am sure of this because this is its tabulation
. tabulate Dgiveupbinary
Dgiveupbina |
ry | Freq. Percent Cum.
------------+-----------------------------------
0 | 7,809 71.37 71.37
1 | 3,132 28.63 100.00
------------+-----------------------------------
Total | 10,941 100.00
Dgiveupbinary only takes zero or one values.
When I try to run a simple two class latent class model using the following command
. gsem (Dgiveupbinary <- ), logit lclass(C 2)
I get the following error
"
. gsem (Dgiveupbinary <- ), logit lclass(C 2)
option lclass() not allowed;
option lclass() is not allowed with models specified with continuous latent variables
r(198);
"
I don't understand why it believes the variable is not categorical when it is only zeros and ones. I've done some reading and there doesn't seem to be any way that Stata officially labels a variable as continuous or categorical.
Thoughts? Any help is greatly appreciated.
Bailey Norwood
Comment