Announcement

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

  • In gsem, the log-likelihood remains 0 no matter what variables you put in and does not converge

    I am a beginner in Japanese stuttering and my English and software handling are not very good, but I would like to ask one question.

    gsem (Nouse_not_necessary Nouse_satisfied no_app_bank Nouse_no_OD Nouse_private_scooter Nouse_travel_with_children Economic_reasons Low_competence Inlra Safety_reasons <-, logit)(C <- メスAge_3544 Age_4554 Age_5564 Age_65),lclass(C 3)

    When the above code is run, the log likelihood remains at 0 with no sign of convergence. Since there is no sign of change when the number of variables used in the analysis is reduced, we must be doing something wrong.

    The results of the analysis are output as follows

    . gsem (Nouse_not_necessary Nouse_satisfied no_app_bank Nouse_no_OD Nouse_private_scooter Nouse_travel_with_children Economic_reasons Low_competence
    > Inlra Safety_reasons <-, logit)(C <- Female Age_3544 Age_4554 Age_5564 Age_65),lclass(C 3)

    Fitting class model:

    Iteration 0: (class) log likelihood = -1345.7992
    Iteration 1: (class) log likelihood = -1257.4052
    Iteration 2: (class) log likelihood = -1255.4867
    Iteration 3: (class) log likelihood = -1255.4838
    Iteration 4: (class) log likelihood = -1255.4838

    Fitting outcome model:

    Iteration 0: (outcome) log likelihood = -23339.091
    Iteration 1: (outcome) log likelihood = 0
    Iteration 2: (outcome) log likelihood = 0

    Refining starting values:

    Iteration 0: (EM) log likelihood = -1255.4838
    Iteration 1: (EM) log likelihood = -1255.4838

    Fitting full model:

    Iteration 0: log likelihood = 0 (not concave)
    Iteration 1: log likelihood = 0 (not concave)
    Iteration 2: log likelihood = 0 (not concave)
    Iteration 3: log likelihood = 0 (not concave)
    Iteration 4: log likelihood = 0 (not concave)
    Iteration 5: log likelihood = 0 (not concave)
    Iteration 6: log likelihood = 0 (not concave)
    Iteration 7: log likelihood = 0 (not concave)
    Iteration 8: log likelihood = 0 (not concave)


    Iterations will continue until 8000 is exceeded, but no convergence will occur.

    We apologize and ask for your patience.

    Data is binary data in 1 or 2

    From Japan at midnight
    Hizaki​​​​​​​

  • #2
    A first problem is that you have variables with capital letters. sem and gsem treat any variables with a capital letter as a latent variables. You need to add the option nocapslatent to your gsem statement.
    Code:
    gsem (Nouse_not_necessary Nouse_satisfied no_app_bank Nouse_no_OD Nouse_private_scooter ///
                      Nouse_travel_with_children Economic_reasons Low_competence ///
                      Inlra Safety_reasons <-, logit) (C <- Female Age_3544 Age_4554 ///
                      Age_5564 Age_65),lclass(C 3) nocapslatent
    Aside from that, the statement looks fine, but you may have to play with starting values to get gsem to converge. See this thread and look at posts by Weiwen Ng, who has done a ton of work sharing what they have learned about latent class analysis in Stata.

    Comment


    • #3
      Thank you for your instruction. However, the following situation does not seem to change even if I use that command... I will check the thread, but if you know anything, I would appreciate your comments.


      . gsem (Nouse_not_necessary Nouse_satisfied no_app_bank Nouse_no_OD Nouse_private_scooter ///
      > Nouse_travel_with_children Economic_reasons Low_competence ///
      > Inlra Safety_reasons <-, logit) (C <- Female Age_3544 Age_4554 ///
      > Age_5564 Age_65),lclass(C 3) nocapslatent

      Fitting class model:

      Iteration 0: (class) log likelihood = -1345.7992
      Iteration 1: (class) log likelihood = -1257.4052
      Iteration 2: (class) log likelihood = -1255.4867
      Iteration 3: (class) log likelihood = -1255.4838
      Iteration 4: (class) log likelihood = -1255.4838

      Fitting outcome model:

      Iteration 0: (outcome) log likelihood = -23339.091
      Iteration 1: (outcome) log likelihood = 0
      Iteration 2: (outcome) log likelihood = 0

      Refining starting values:

      Iteration 0: (EM) log likelihood = -1255.4838
      Iteration 1: (EM) log likelihood = -1255.4838

      Fitting full model:

      Iteration 0: log likelihood = 0 (not concave)
      Iteration 1: log likelihood = 0 (not concave)
      Iteration 2: log likelihood = 0 (not concave)

      The data is in the following format

      Nouse_satisfied no_app_bank Nouse_no_OD Nouse_private_scooter Nouse_travel_with_children not_necessary Practical_reason Unabletouse_reason Totalban Banpavementriding
      2 1 2 1 1 2 1 2 1 1
      1 1 1 1 1 2 1 1 1 1
      2 1 2 1 1 2 1 2 1 1
      2 1 2 1 1 2 1 2 1 1

      Comment

      Working...
      X