Announcement

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

  • Specify number of iterations to fit an fmm model that is not concave

    Hi Statalist,

    I'm using fmm: logit in Stata 15.1. My dataset contains ~21000 observations and I'm trying to fit a 3 components finite mixture model with 15 covariates (x1-x15) to explain my binary outcome y. However, I failed to do so with "not concave" error message.
    My code:
    Code:
    fmm 3: logit y x1 x2 ... x15
    I've searched for a solution and tried specifying the number of iterations:
    Code:
    fmm 3, iterate(#): logit y x1 x2 ... x15
    After trying 200, 500, 1000, 5000 and 10000 iterations, I found that from the iteration number 1000, the results seem to stabilize (the probabilities, mean value of each class and the coefficients from 3 sets of logit model). However, as the model does not converge at all, I suppose these results are not reliable.

    I also tried running fmm for each covariate to figure out which variable causing the not concave status but it seemed that all failed again with a "not concave" message. I haven't found any example on applying fmm: logit model.

    Could you please give me some advice on this?
    Thank you very much for your time!

    Best regards,
    Nina Nguyen.
    Last edited by Nina Ng; 29 Apr 2019, 11:22.

  • #2
    It is best to follow the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. Sometimes you can have errors in your code that you don't think are important and so don't include the errors in summaries like you provide.

    The documentation says this is legit, so the problem is probably in your data. However, there is no way to diagnose data problems when we can't run the model. It is odd that even the one rhs variable models have the same problem. I'd check that you have a reasonable number of 0's and 1's in y. I'd check that the sample size is good - run the logit without fmm and see if it works OK. Try using one of the datasets provided with logit or in one of the examples (modifying the dv to be 0/1) and see if you can get fmm to run.

    See this discussion:

    https://www.statalist.org/forums/for...-of-iterations



    Comment


    • #3
      Hi Phil,

      Thank you very much for your response. I'm using data from Eurobarometer, a European survey on following topics: (1) Quality of Transport, (2) Cyber Security, (3) Value Added Tax, and (4) Public Health. The 2014 survey consisted of 26849 observations. Y is an indicator of the willingness to donate one's organ after death (Yes - 1 and No - 0). The explanatory variables include either binary variables (legislative framework of the country (presumed/informed consent), gender, knowledge, rural/urban area, motivation to donate one's organ) or categorical variables (number of education years, generation (X, Y, baby boomer and silent))

      I tried with logit and it worked totally fine
      Code:
       logit tissue_donate presume agegen2 female knowledge rural education altru2 altru_egoi2  egoi2,    vce(robust)
      
      Iteration 0:   log pseudolikelihood = -17594.513  
      Iteration 1:   log pseudolikelihood = -11081.232  
      Iteration 2:   log pseudolikelihood = -10920.872  
      Iteration 3:   log pseudolikelihood = -10912.482  
      Iteration 4:   log pseudolikelihood = -10912.454  
      Iteration 5:   log pseudolikelihood = -10912.454  
      
      Logistic regression                             Number of obs     =     25,638
      Wald chi2(9)      =    4902.63
      Prob > chi2       =     0.0000
      Log pseudolikelihood = -10912.454               Pseudo R2         =     0.3798
      
      
      Robust
      tissue_donate       Coef.   Std. Err.      z    P>z     [95% Conf. Interval]
      
      presume   -.0830098   .0367287    -2.26   0.024    -.1549967    -.011023
      agegen2   -.0170715   .0175198    -0.97   0.330    -.0514097    .0172668
      female    .0584954    .033928     1.72   0.085    -.0080023    .1249931
      knowledge    .3180312   .0343678     9.25   0.000     .2506716    .3853908
      rural   -.0391592   .0367107    -1.07   0.286    -.1111108    .0327925
      education    .1179921   .0254065     4.64   0.000     .0681964    .1677879
      altruistic2    4.740748   .0953917    49.70   0.000     4.553784    4.927713
      altru_egoi2   -2.906712    .104096   -27.92   0.000    -3.110736   -2.702687
      egoistic2     3.43555   .0947867    36.25   0.000     3.249772    3.621329
      _cons   -4.115112    .123224   -33.40   0.000    -4.356626   -3.873597
      However when I used fmm function, the model did not concave:
      Code:
      fmm 2: logit tissue_donate presume agegen2 female knowledge rural education altru2 altru_egoi2  egoi2
      In my sample, the proportions of Y are roughly 45% 0's and 55% 1's.

      Could you please tell me more about your suggestions (i.e. try using one of the datasets provided with logit or in one of the examples (modifying the dv to be 0/1) and see if you can get fmm to run)?

      Thank you very much!
      Nina Nguyen.

      PS: sorry I could not manage to format the output table look nicer.

      Comment

      Working...
      X