Announcement

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

  • convergence error in mixed effect model for partially nested design

    Dear Statalist members,

    I am analyzing a partially nested design in a cost-effectiveness study (cost and QALY outcomes). The data are in long format, with the outcome variable y (containing both cost and QALY), distinguished by a binary variable type (e.g., 0 = cost, 1 = QALY), and group for arm (0 = control, 1 = intervention).

    Key features of the design:
    • Several sites include both intervention and control participants (so sites are crossed with group).
    • Clinicians (identified by cid) are only present in the intervention arm (clustering via clinicians only applies to intervention).
    • Individuals (pid) are in both arms.
    • Variances differ between arms (heteroscedastic by design).
    • I need to account for correlation between cost and QALY at both the cluster (clinician/cid) level and the individual (pid) level.
    My current command is:

    text
    mixed y i.type i.type#i.group || site: || cid:group || pid:, nocons ml residuals(ind, t(type) by(group)) nolog
    This produces a convergence error (typically something like "convergence not achieved".
    What is the recommended syntax for handling a partially nested design where clustering (cid) only applies to one arm?
    How can I properly model the correlation between cost and QALY at cluster and individual levels?

  • #2
    .

    Comment


    • #3
      In my experience, the commonest reasons for non-convergence of -mixed- are a variance component which is very close to zero (or even is, in fact, zero or negative), or a coefficient or standard error whose value is infinite under maximum likelihood estimation. These problems can be diagnosed by looking at the non-converged output you got.


      Is there a coefficient or standard error in the fixed-effects part of the model whose value is extremely an extremely large (in magnitude) positive or negative number? If so, that variable's effects are not very well estimable, and that effect should be removed.

      Is one of the random effects estimates very close to zero? If so, remove that random effect from the model. Sometimes, instead of totally removing a random effect from the model, you can instead replace it by a fixed effect--which is a good idea anyway if it is given by a variable with a small number of levels.

      That said, I do not understand "Clinicians (identified by cid) are only present in the intervention arm (clustering via clinicians only applies to intervention)" and I'm having trouble imagining how your data set represents this. If the cid variable is missing from all observations with group = 0, then there will be no observations with group = 0 in the estimation sample. That will, in turn, obliterate your interaction term, and even if the model converged, it would provide no estimate of the intervention effect. Moreover, it would not surprise me if it turned out that the cid random intercept itself or the cid:group random slope is the cause of the non-convergence under this design.

      If you have designed some way other than missing values for the cid variable to represent that non-instantiation of clinicians in the control group, you should probably post back showing and explaining it, since it is hard for me to see how it would be a valid specification of the study design.

      Bottom line: if a simple inspection of the output you have does not identify the source of the non-convergence, I think you will need to post back showing the -mixed- output in its entirety, and example data (use the -dataex- command to show the example data) that includes observations from both study arms and all of the variables mentioned in your -mixed- command.

      Added: It is also unclear to me why you specified the fixed-effects part of the model as -i.type i.type#i.group-. Why not the full -i.type##i.group-? What you showed is not a proper specification of a type X group interaction unless group itself does not vary. But if group itself does not vary, then your data cannot give you any information about intervention effects.

      I'm also inclined to think that including two different outcome variables, cost and QALYs, in a single model and trying to squeeze out simultaneous estimates for both by using an interaction term, while clever, is misguided. For example, the model, as you have coded it, constrains all of the random intercepts (except perhaps the residuals) and slopes to be the same for both outcomes, which I think is a highly implausible assumption. I think -mixed- is just not up to this level of complexity. I think you will need to use -gsem- to handle this. (But, be warned, neither -gsem- nor any other estimation command will be able to give you intervention effects while also modeling cid effects if cid is always missing in one of the arms. I think you will need to do an overall model of intervention effects without modeling cid clustering of observations, and then to do a within-intervention-group-only analysis to estimate the impact of cid clustering.)

      Last edited by Clyde Schechter; 20 Feb 2026, 11:14.

      Comment

      Working...
      X