Announcement

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

  • how to code socio demographic data for latent class analysis

    Hello, I am trying to do latent class analysis of discrete choice experiment. I am using lclogit2 and following yoo, 2020 article. I want to add sociodemographic data as membership. I have 3 education level (school level, college level, University level). I do not understand how can I code the education level. I code it as dummy like "gen edu_uni". But when I run it they are saying convergens not achieved.
    I am very new in stata. I am looking forward for your kind help.
    Last edited by Shanjida Sharmin; 18 Jul 2024, 18:12.

  • #2
    This isn't a Stata programming problem per se, this is just an unfortunate feature of SEM. SEM models will not always converge even under the best of circumstances. This could be for a wide variety of reasons. For example, education may not be determined by your set of latent classes, which you might see manifested as partial correlations in the residuals under the model. You may have also eliminated the important variation in education by dummy coding it. You could always try putting the i. prefix in front of your original three-level education variable.

    Code:
    i.education
    This will let gsem know education is a factor variable with levels rather than a quantitative variable. One good troubleshooting step is to look at the model without education, then fix the parameters for the education inclusive model to the values you see in the model without education. That might help the model converge.

    It's possible that if you post your model and provide a little more information about what you are trying to do from a theoretical standpoint, someone here can give you more guidance as to what is going wrong. Be sure to wrap the Stata code in CODE tags (see the # symbol in the editor).

    You are trying to apply a difficult and advanced technique, particularly for someone new to Stata. Good luck.

    Comment


    • #3
      Thank you for your reply. The following code I am using.

      lclogit2 choice, ncl(4) rand(org_northern_ gen_female_ lic_yes_ rev_reliable_ pri_ none) membership (edu_uni edu_clg edu_scl) group(obs) id(si_no) seed(1234)

      I want to see in this 4 classes is there any significance of education level. like which class are highly educated or something like that. I also tried with age, income, gender as membership and got results. But when I try with education it does not work.
      Actually I want to see the sociodemographic characteristics of different classes.


      I have also tried without any membership. like "lclogit2 choice, ncl(4) rand(org_northern_ gen_female_ lic_yes_ rev_reliable_ pri_ none) group(obs) id(si_no) seed(1234)" and it works and I got my result. But when I add education it does not found convergence.
      What could be the solution?
      Last edited by Shanjida Sharmin; 19 Jul 2024, 17:20.

      Comment

      Working...
      X