Announcement

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

  • Subject: How to resolve Hessian problem while retaining an unstructured random intercept–slope covariance

    Dear Stata Technical Support,

    I am analyzing longitudinal DXA Z-score data from 161 patients with 1,771 repeated observations. The number of observations per patient ranges from 1 to 33 (mean 11).

    My primary objective is to examine change in DXA Z-score over time and determine whether the longitudinal trajectory differs by anatomical DXA site (spine, hip, radius) and by bisphosphonate exposure. Therefore, the principal fixed effects of interest are the interactions between time and anatomical site and between time and bisphosphonate exposure. Multiple imputation

    Some observations have missing height (ht) and/or weight (kg). I therefore used multiple imputation by chained equations with predictive mean matching (20 imputations):
    mi set mlong
    mi register imputed ht kg
    mi impute chained (pmm, knn(5)) ht kg = c.age_at_the_messuremnet##c.age_at_the_messuremnet i.genderfemale1 c.ageatthestartoftreatment i.splenectomy1yes, add(20) rseed(12345)

    BMI was then calculated from the imputed height and weight values as a passive variable:
    mi passive: generate bmi = kg/(ht^2)

    units /kg was also calculated passively
    mi passive: generate bmi = kg/(ht^2)
    Mixed-effects model

    I would ideally like to allow patients to differ both in their baseline Z-score and in their rate of change over time. I therefore specified a subject-specific random intercept and random slope for tx_dexa_years, allowing the two random effects to be correlated:
    mi estimate, post: mixed z_score c.tx_dexa_years##ib1.z_sitespine1hip2radius3 ib2.genderfemale1 i.splenectomy1yes i.n370s_homozygous1yes i.ever_smoked c.interval_symptom_tx c.zimran_score c.ageatthestartoftreatment ib1.erttypealglecerase1imiglucerase2 c.tx_dexa_years##i.bisphosphonates_year c.bmi c.ukg || subject_id: c.tx_dexa_years, covariance(unstructured)

    However, this model fails during multiple-imputation estimation with:
    Hessian is not negative semidefinite
    an error occurred when mi estimate executed mixed on m=1
    r(430);

    When I fit the same fixed-effects model but constrain the random intercept and random slope to be independent:
    mi estimate, post: mixed z_score c.tx_dexa_years##ib1.z_sitespine1hip2radius3 ib2.genderfemale1 i.splenectomy1yes i.n370s_homozygous1yes i.ever_smoked c.interval_symptom_tx c.zimran_score c.ageatthestartoftreatment ib1.erttypealglecerase1imiglucerase2 c.tx_dexa_years##i.bisphosphonates_year c.bmi c.ukg || subject_id: c.tx_dexa_years, covariance(independent)

    sd(tx_dexa_years) = 1.93e-06
    SE = 0.0005034
    95% CI = 2.2e-228 to 1.7e+216

    sd(random intercept) = 1.024465


    I would also like to add that I fitted the same fixed-effects specification using only a subject-specific random intercept:

    mi estimate, post: mixed z_score c.tx_dexa_years##ib1.z_sitespine1hip2radius3 ib2.genderfemale1 i.splenectomy1yes i.n370s_homozygous1yes i.ever_smoked c.interval_symptom_tx c.zimran_score c.ageatthestartoftreatment ib1.erttypealglecerase1imiglucerase2 c.tx_dexa_years##i.bisphosphonates_year c.bmi c.ukg || subject_id:

    with this output
    Random-effects parameters | Estimate Std. err. [95% conf. interval]
    -----------------------------+------------------------------------------------
    subject_id: Independent |
    sd(tx_dexa_years) | 1.93e-06 .0005034 2.2e-228 1.7e+216
    sd(_cons) | 1.024465 .0615547 .9106533 1.152502
    -----------------------------+------------------------------------------------
    sd(Residual) | .7156624 .0126212 .6913478 .7408321
    ------------------------------------------------------------------------------



    My preference, if statistically appropriate, would be to retain the random intercept, random slope, and covariance(unstructured) specification.

    1. Could you please advise whether there are modifications or diagnostic steps in Stata that might allow me to fit the unstructured random-effects model reliably across the multiply imputed datasets?

    2. I would also be interested to know whether the multiple imputation of height and weight, and the subsequent passive calculation of BMI, could contribute to the instability of the random-slope/unstructured model, and whether you would recommend any additional MI diagnostics in this setting.
    3. Finally, if the unstructured specification cannot be estimated reliably, what random-effects structure would you recommend as the closest appropriate alternative while preserving my fixed time × anatomical-site and time × bisphosphonate interactions?

    I have the complete .do and .log files available, and attach them

    Kind regards
    Oana
    Attached Files

  • #2
    The low variance of your random effect for time with the independent structure suggests that the fixed-effect model has absorbed all variance in that dimension, so when you extend the model to an unstructured covariance structure, then the model is unlikely to ever converge. You might consider simplified the model to only your time variable in your fixed effects to see how the different covariance structures are supported. It may be that you don't have enough data in each of the patterns on the full model to properly estimate it too, in which case more data or simpler models are the only remedy.

    Comment


    • #3
      Dera Leonardo,

      Thank you again for your previous advice regarding my longitudinal mixed-effects analysis.

      I have a related question regarding multiple imputation of two time-varying covariates.

      My original longitudinal dataset contains 8,790 observations from approximately 221 subjects now! Height (ht) is observed in 6,514 observations and missing in 2,276 (approximately 26%), while weight (kg) is observed in 6,392 and missing in 2,398 (approximately 27%). Subjects have multiple repeated height and weight measurements over time.

      I want to impute only height and weight. I do not want to impute the DXA Z-score outcome.

      I currently use predictive mean matching with chained equations:
      mi set mlong mi register imputed ht kg mi impute chained /// (pmm, knn(5)) ht kg = /// c.age_at_the_messuremnet##c.age_at_the_messuremnet /// i.genderfemale1 /// c.ageatthestartoftreatment /// i.splenectomy1yes, /// add(20) rseed(12345)
      The imputation runs successfully.

      However, because height and weight are repeated measurements within subjects, I am concerned that this specification does not explicitly account for the clustering/longitudinal structure. In particular, a subject's own observed height and weight measurements at other time points would seem highly informative for their missing measurements.

      Could you please advise what you would recommend in Stata for imputing these two longitudinal continuous variables while accounting for repeated measurements within subject_id?

      Would you recommend a multilevel imputation approach, inclusion of subject-specific information in mi impute chained, or another method?

      My final outcome analysis will use the observed DXA Z-scores; I do not intend to impute missing Z-scores.

      Many thanks for your advice.

      Kind regards,
      Oana

      Comment


      • #4
        Hi Oana,

        It is generally preferable not to address posts/comments to specific forum members.

        I don't have specific advice to help you with regard to imputation, other than to agree that a multilevel approach is probably preferable. That said, I would question if you might be overcomplicating your approach for height and weight (but I don't know your project or context). In adult populations, it is often reasonable to treat height as constant - so if you have at least one measurement of height, you can copy that value to impute the others. Weight is more variable, and again, depending on the time frame of your study, it might be more reasonable to use interpolation between visits.

        Also as an aside, I have a small research interest in splenectomy and hemolytic anemia, so it struck me as a peculiar choice to use splenectomy history as an indicator of both height and weight -- but again, you may have valid reasons for this choice.

        Comment


        • #5
          Hi Leonardo,
          I Apologize for sending the message directly, I wasn't aware that tis will happen. Many thanks for taking the time to replay. I have children and adults , and some individuals have data as children and adults. This is a study about Gaucher Disease, which affects children/ adults; splenectomy is a sigh of worse disease, therefore is a way of controlling for disease severity (which impacts in weight and height). Sorry, I am send you another DM but I wanted to address the particular context for splenectomy.

          Comment


          • #6
            Ah that explains the inclusion of splenectomy then, thanks for sharing the disease under study.

            Comment

            Working...
            X