Announcement

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

  • LCA(Latent Class Analysis) still "not concave" and No Results in "gsem"

    Dear Friends, I tried to use LCA in stata15 for my paper. I want to classify the observed people into 4 or 5 groups. Then I could analyze the characters of every group But I met some errors in my results, and I don’t know how to solve it. I really need your help.
    Thank you very much!

    1.why “option latentclass() not allowed”?
    2. when I used the code “gsem (hr hq hw hl hv ha <-,ologit),lclass(C 4)” , why it still printed “not concave”?
    3.as the picture

    MY DATA,

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long hhid double(hr hq hw hl hv ha)
    2013000001 1 2 4 0 5 5
    2013000002 1 1 2 0 5 3
    2013000004 1 2 4 0 5 5
    2013000005 1 1 3 0 5 4
    2013000006 1 1 1 0 5 3
    2013000007 1 1 1 0 2 3
    2013000008 1 1 4 0 5 3
    2013000009 1 1 1 0 5 3
    2013000010 0 0 0 0 1 1
    2013000011 1 1 4 1 5 3
    2013000012 0 0 0 0 1 1
    2013000013 1 1 1 0 5 3
    2013000014 1 1 2 0 5 2
    2013000015 1 1 1 0 5 3
    2013000016 0 0 0 0 1 1
    2013000017 1 2 4 1 5 5
    2013000018 0 0 0 0 1 1
    2013000020 0 0 0 0 1 1
    2013000021 1 2 4 1 5 3
    2013000022 1 1 2 0 5 2
    2013000023 1 1 2 0 5 3
    2013000026 1 1 4 1 5 2
    2013000027 0 0 0 0 1 1
    2013000028 0 0 0 0 1 1
    2013000030 1 1 2 0 4 2
    2013000031 0 0 0 0 1 1
    2013000033 0 0 0 0 1 1
    2013000034 0 0 0 0 1 1
    2013000035 0 0 0 0 1 1
    2013000036 0 0 0 0 1 1
    2013000037 1 1 1 0 5 2
    2013000041 1 2 2 0 5 3
    2013000042 0 0 0 0 1 1
    2013000043 0 0 0 0 1 1
    2013000044 1 1 1 0 5 2
    2013000046 0 0 0 0 1 1
    2013000047 0 0 0 0 1 1
    2013000048 0 0 0 0 1 1
    2013000049 1 1 2 0 2 5
    2013000050 0 0 0 0 1 1
    2013000051 1 1 2 0 5 2
    2013000052 1 2 3 0 5 3
    2013000053 1 1 2 0 5 2
    2013000054 0 0 0 0 1 1
    2013000056 0 0 0 0 1 1
    2013000057 0 0 0 0 1 1
    2013000059 0 0 0 0 1 1
    2013000061 0 0 0 0 1 1
    2013000062 0 0 0 0 1 1
    2013000063 1 1 2 0 5 2
    end









    Attached Files

  • #2
    Zhenliang, thanks for presenting a data example. You should note, though, that the FAQ recommends that we not post our results or code in screenshots. They can be illegible, and they have to be copied manually.

    First, the option to fit the model over latent classes is -lclass-, not -latentclass-. Stata does not understand English, so it doesn't recognize that -latentclass- is the long form of -lclass-, because the first few letters don't match.

    Second, you didn't ask, but in one of your screenshots, you have an error where Stata thought that "logit" was a latent variable. This is because you forgot the comma after the arrow. You may not have noticed this error, but you must have the comma, or else Stata will think that there's a continuous latent variable identified through the indicators hr, hq, hw, etc.

    Code:
    gsem (hr hq hw hl hv ha <- , ologit), lclass(C 3)
    Last, the not concave issue means that Stata can't find a global maximum. The likelihood function is not concave in the region that the maximization algorithm told it to step.

    In my experience in this context, this might be because one of the classes has a logit intercept that is tending to infinity or negative infinity. This corresponds to a nearly 1 or nearly 0 probability of responding in a category for an ordered logit model, or endorsing the item at all for a binary item. This problem will be magnified if the latent class is small, and I bet that treating the items as ordered logit further magnifies it if the responses are skewed (e.g. if few people respond in the highest level of a question, or if few people respond in the lowest one).

    Code:
    gsem (hr hq hw hl hv ha <- , ologit), lclass(C 3) nonrtolerance
    If you use the -nonrtolerance- option, you will tell Stata to ignore the fact that the likelihood is not concave. You should then inspect the parameters reported (or use -estat lcmean-). Anything with a missing standard error is suspect. This thread will show you how to constrain a logit intercept at + or - 15 and re-fit your model with the normal convergence requirements. You should decide if it's plausible that nearly 0% of a latent class endorse an item. If you decide it's plausible, you should report what you have done. Never treat results obtained with the -nonrtolerance- option as final. Also, be aware that best practice in the field is to use many random draws and choose the one with the highest consistently-converged likelihood. You should use the -startvalues(randomid, draws(n))- option, probably once you are fitting the 4 class solution.

    You might be justified in collapsing some categories or even treating the variables as binary. Latent class analysis is an exploratory technique, so I think this would be acceptable in some circumstances.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment

    Working...
    X