Announcement

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

  • Convergence not Achieved in Mixed Model

    Hi,

    I am trying to fit a crossed-effects mixed model in my data but Stata returns the following error: "likelihood evaluates to missing r(430)". Here's the command I'm using:

    mixed choice || _all: R.id || _all: R.scenario, reml

    I can fit this model in a subset of my data, but when I use all my data (600 individuals, 10 observations per person), the model does not converge. I've tried some of the options specified in the maximize manual (e.g., changing how the likelihood function is maximized using the technique option, specifying difficult), but I get the same error message when I run the model on the entire sample.

    Any help on how to solve this issue would be much appreciated.

    Thank you

  • #2
    This is just a guess. The way you have specified the crossed effects is going to require a very large matrix to hold all of the interim estimates. The following specification is for the same model and requires a much smaller matrix:

    Code:
    mixed choice || _all: R.scenario || id:, reml
    See if that works.

    That said, with only 10 scenarios (I assume each observation is one within-person scenario) I wonder whether it makes sense to use scenario as a random effect. An N = 10 sample of scenario space is not going to give you a good estimate of variation attributable to scenarios. Absent a compelling reason, I'd be inclined to make this just a two level model with i.scenario as one of the ixed effects, and only id: as a random effect. (And if you can't get the crossed effects model this is probably the best fallback in any case.)

    Comment


    • #3
      Thank you, Clyde!

      Your guess is correct, and the code that you shared works. Also, I agree that it might not be best to use random effects for scenario given that there are only 10 scenarios in the data, perhaps a fixed effects model is more appropriate.

      Once again, thank you! I really appreciate the thoughtful reply.

      Comment


      • #4
        Hello,

        I am trying to model serial head circumference measurements (HC_mm) using LMM. The measurements were taken from pregnant women at different scans (var: scan) and each woman has a unique id (var: id).

        This is the model I have written, but it does not converge. Please help.

        mixed HC_mm ///
        GA_div10_sq GA_div10_sqln || scan: || id : ga_at_usd_visits_wks_ , ///
        cov(exch) nolog reml


        note:
        ga_at_usd_visits_wks_ - gestational age in weeks, i am specifying this as a random slope within each patient (is this appropriate)??
        GA_div10_sq GA_div10_sqln - these are polynomial terms of gestational age, derived from fractional polynomial regression to account for the non-linearity of the HC growth during gestation, hence are specified as fixed effects here.


        Comment


        • #5
          Originally posted by Dhruv Darji View Post
          . . . gestational age in weeks, i am specifying this as a random slope within each patient (is this appropriate)??
          1. Why are you specifying an exchangeable covariance structure if you want to model a random slope?

          2. Why are you modeling a linear random slope if you believe that you must "account for the non-linearity of the HC growth during gestation"?

          3. Why are you dividing the fixed-effects gestational age by 10, but not the random slope?

          GA_div10_sq GA_div10_sqln - these are polynomial terms of gestational age, derived from fractional polynomial regression. . .
          Is there a reason not to just model a quadratic polynomial relationship using Stata's factor notation,e.g., c.ga##c.ga?

          The measurements were taken from pregnant women at different scans (var: scan) . . .
          I take it that "different scans" means anatomical orientation (lateral, anterior-posterior) and not the temporal sequence of medical imaging session (which would risk being collinear with gestational age). Regardless, it probably shouldn't be fitted hierarchically.

          This is the model I have written, but it does not converge. Please help.
          Assuming what the variable scan represents, then maybe try something like the following to start with.
          Code:
          rename HC_mm hci
          rename ga_at_usd_visits_wks_ age // assumes that GA_div10_sqln is this divided by 10
          rename id pid
          
          mixed hci c.age i.scan || pid: , reml dfmethod(kroger) nolrtest
          
          // If that converges, then maybe
          mixed hci c.age##c.age i.scan || pid: , reml dfmethod(kroger) nolrtest
          If these converge cleanly, then consider adding terms to model a random slope, but a random slope might not add that much explanatory power over those there.

          Comment


          • #6
            Hi Joseph,
            Thanks a lot for your feedback. [I do not have a statistical background, please pardon my errors in responding to your questions]

            1. Why are you specifying an exchangeable covariance structure if you want to model a random slope?
            I don't have a clear reason for this. But the model didn't converge with an unstructured covariance structure.

            2. Why are you modeling a linear random slope if you believe that you must "account for the non-linearity of the HC growth during gestation"?
            No clear reason here again, I assumed specifying the (linear form) age as a random slope allows the measurements to vary by gestational age. I didn't account the non-linearity when specifying the age as a random slope.
            Do you suggest it is more appropriate to specify the polynomial forms of age as the random slopes in this case?

            3. Why are you dividing the fixed-effects gestational age by 10, but not the random slope?
            This was the output from the fractional polynomial regression that I got. I used the following code to get the best fitting polynomial terms.
            Code:
            xrigls HC_mm ga_at_usd_visits_wks_, fp(m:df 4,s:df 2) centile(3  50  97) detail nogr
            Is there a reason not to just model a quadratic polynomial relationship using Stata's factor notation,e.g., c.ga##c.ga?
            I have not tried this, but the best fitting powers were not quadratic terms. This is the equation from the fractional polynomial model (code above) for head circumference:

            HC= (-24.72997)+ [(75.90943)( X^2 )] + [(-38.86433)(X^2×ln⁡X )] where X = (Gestational age (weeks))/10

            Hence, I used these forms of X as the fixed effects of my model. See scatter plot of my head circumference data across gestation:
            Click image for larger version

Name:	HC_HIV.png
Views:	1
Size:	63.9 KB
ID:	1758903





            I take it that "different scans" means anatomical orientation (lateral, anterior-posterior) and not the temporal sequence of medical imaging session (which would risk being collinear with gestational age). Regardless, it probably shouldn't be fitted hierarchically.
            The different scans is NOT the anatomical orientation, rather it is the temporal sequence representing scan sessions that each pregnant woman attended. I.e., scan 1, scan 2 etc. Up to scan 6.

            Comment


            • #7
              Originally posted by Dhruv Darji View Post
              The different scans is NOT the anatomical orientation, rather it is the temporal sequence representing scan sessions that each pregnant woman attended. I.e., scan 1, scan 2 etc. Up to scan 6.
              Inasmuch as you already account for time in terms of gestational age, I suggest omitting scan from the model.

              In light of that graph with the number of patients and data points shown (about four per patient), and given your objective ("I am trying to model serial head circumference measurements (HC_mm) using LMM."), you could try something like the following
              Code:
              mixed hci c.age##c.age || pid: , mle
              and seeing whether that attains your objective.

              Comment

              Working...
              X