Announcement

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

  • mixed effect model is not converging and keeps iteration indefinitely

    Hello,

    I'm using Stata 15.1 and I have a problem with the mixed effect model, it doesn't converge but continue to iterate indefinitely

    I don't have an error message to share with you but here I copied part of the output, the iteration will run until I break it ( it was going to over 590 iteration lines one time)



    Click image for larger version

Name:	Stata error output.PNG
Views:	1
Size:	36.4 KB
ID:	1584196



    here is a sample of my data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float studycode str11 subjid byte aeyn float(age sex hdcat)
    3 "011-915-432" 0 35 0 2
    3 "013-009-435" 0 69 0 2
    3 "013-009-435" 0 71 0 2
    3 "013-009-435" 0 69 0 2
    3 "015-044-111" 0 58 0 2
    3 "015-044-111" 0 56 0 2
    1 "015-044-111" 0 59 0 2
    1 "015-044-111" 0 60 0 2
    1 "015-044-111" 0 59 0 2
    3 "016-877-556" 0 47 0 2
    3 "016-877-556" 0 47 0 2
    3 "016-877-584" 0 44 1 2
    3 "017-871-584" 0 46 1 2
    3 "019-321-124" 0 56 1 2
    3 "020-234-495" 0 55 0 2
    3 "021-000-241" 1 42 0 2
    3 "021-444-846" 0 58 0 2
    3 "022-098-47X" 0 30 1 1
    2 "025-432-263" 1 38 1 1
    3 "026-123-091" 0 50 1 0
    end
    label values studycode studyname
    label def studyname 1 "studyhat", modify
    label def studyname 2 "studyyat", modify
    label def studyname 3 "studycat", modify
    label values aeyn adverse_events
    label def adverse_events 0 "no", modify
    label def adverse_events 1 "yes", modify
    label values sex gender
    label def gender 0 "male", modify
    label def gender 1 "female", modify
    label values hdcat diseasecatg
    label def diseasecatg 0 "control", modify
    label def diseasecatg 1 "presymptomatic", modify
    label def diseasecatg 2 "symptomatic", modify

    The below explains the general concept of my data:

    I have 500 subjid who participated in one or more of studies 1,2,3 , and had intervention each time they participate( so they might have the repeated intervention within the same study or they had it repeated in 2 different studies ).

    here is the command


    Code:
     melogit sex i.aeyn || _all: R.studycode|| _all: R.subjid
    P.S I don't have missing values in these variables used.

    your help is greatly appreciated.

  • #2
    Does the outcome vary within patients within studies that they participated in? Within patients between studies?

    Comment


    • #3
      Yes it does vary within patients and within studies.

      Comment


      • #4
        Originally posted by Yara Hassan View Post
        Yes it does vary within patients and within studies.
        Perhaps your patients don't change sex often enough, though.

        Comment


        • #5
          it seems I didn't understand what you are referring to in your question correctly but anyway the error also happens with almost all other variables I put instead of sex, for example :

          Code:
          meologit hdcat i.aeyn || _all: R.studycode|| _all: R.usubjid

          Comment


          • #6
            Scanning through your smidgen of a data extract, hdcat doesn't seem to change, either.

            My guess is that you just don't have enough happening—enough information—in your observational study results to fit a cross-classified random effects ordered categorical regression model. And you have only three studies, which is rather few to get a good handle on its variance component, even in a conventional hierarchical arrangement.

            You can try moving the study from the random effects equation to the fixed effects side.
            Code:
            meologit hdcat i.(aeyn studycode) || usubjid:
            By the way, doesn't a patient's experiencing one or more adverse events become manifest only after enrollment into a study and treatment group assignment? If so, then wouldn't that be better modeled as an outcome, itself? You've got what seems like a postintervention observation in your models as a predictor of disease category and sex, which seem more like patient characteristics and not outcomes. I realize that fourfold tables can be turned on their sides and the odds ratios still make sense,
            Code:
            tabulate aeyn sex if studycode == 1, chi2
            logistic aeyn i.sex if studycode == 1 // cf. Wald test statistic
            
            tabulate sex aeyn if studycode == 1
            logistic sex i.aeyn if studycode == 1 // ditto
            but I would have modeled tally of adverse events (or of serious adverse events, whatever) as an outcome, perhaps in a negative binomial regression model or some other count model with, say, a patient's sex as a predictor (not an outcome) and participation interval as an exposure variable.

            Comment

            Working...
            X