Announcement

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

  • Odds ratios in mixed model, REML

    Dear all,

    I have a dataset of samples taken at three consecutive timepoints (scan_nr).

    In an effort to estimate whether the change in a sample estimate (E) over time correlates to a specified outcome (outcome_gr, good or bad outcome) a mixed model was fitted to the dataset.

    The dataset was split in two groups defined by having either a good or bad outcome.

    Code:
    mixed logsample i.scan_nr#i.outcome_gr || rand_nr: , residuals(un,t(scan_nr)) reml technique(bfgs)
    predict res, rstandard
    qnorm res, yscale(range(-6 6))  mlab(rand_nr)
    qnorm res if res<3 & res>-3, yscale(range(-3 3))
    predict fit, fit
    scatter res fit, yscale(range(-6 6)) yline(0)
    drop res fit
    margins scan_nr#outcome_gr, expression(exp(predict(xb)))
    marginsplot, title("E in good versus poor outcome groups") ytitle("median sample")
    STATA output for the following command: mixed logsample i.scan_nr#i.outcome_gr || rand_nr: , residuals(un,t(scan_nr)) reml technique(bfgs)

    Obtaining starting values by EM:

    Performing gradient-based optimization:

    Iteration 0: log restricted-likelihood = -126.80478
    Iteration 1: log restricted-likelihood = -121.53404 (backed up)
    Iteration 2: log restricted-likelihood = -120.91787
    Iteration 3: log restricted-likelihood = -119.28295
    Iteration 4: log restricted-likelihood = -119.279
    Iteration 5: log restricted-likelihood = -117.39115
    Iteration 6: log restricted-likelihood = -116.88247
    Iteration 7: log restricted-likelihood = -116.32189
    Iteration 8: log restricted-likelihood = -115.68504
    Iteration 9: log restricted-likelihood = -115.4023
    Iteration 10: log restricted-likelihood = -115.17604
    Iteration 11: log restricted-likelihood = -114.95332
    Iteration 12: log restricted-likelihood = -114.89151
    Iteration 13: log restricted-likelihood = -114.8646
    Iteration 14: log restricted-likelihood = -114.8577
    Iteration 15: log restricted-likelihood = -114.85561
    Iteration 16: log restricted-likelihood = -114.85486
    Iteration 17: log restricted-likelihood = -114.85484
    Iteration 18: log restricted-likelihood = -114.85484


    Computing standard errors:
    Mixed-effects REML regression Number of obs = 281
    Group variable: rand_nr Number of groups = 99
    Obs per group:
    min = 1
    avg = 2.8
    max = 3

    Wald chi2(5) = 9.56
    Log restricted-likelihood = -114.85484 Prob > chi2 = 0.0888
    Click image for larger version

Name:	Skærmbillede 2018-10-01 kl. 10.20.28.png
Views:	2
Size:	74.3 KB
ID:	1464091

    Click image for larger version

Name:	image_12075.jpg
Views:	2
Size:	218.8 KB
ID:	1464083




    My questions are:
    1. Output: is it in anyway possible to transform the output to odds ratios?
    2. Regarding interpretation: 1#bad outcome: there is no evidence against the null-hypothesis (p=0,052), and scan number 1 in the bad outcome group is not significantly different from scan number 1 in the good outcome group. How do I interpret the rest of the following results? Are they all compared with scan number 1 in the good outcome group?
    I hope you can help!

    Best regards,

    Anders and Thomas

  • #2
    Odds ratios are used when the dependent variable of the model is discrete; you have modeled an apparently continuous variable (or at least you have treated it as such by using -mixed-), so odds ratios are not derivable from this kind of analysis. Depending on the meaning of your variables and the context, it might be sensible to invert the analysis and make outcome_gr the dependent variable, and move logsample to the other side of the equation and then run this as -melogit- or -meqrlogit- In that situation you could get odds ratios in your results if you specify the -or- option.

    With regard to interpreting your -mixed- output, the model is mis-specified, so you should not attempt to interpret it. You should not run a model which includes interaction terms but does not include the constituents of those interactions, except under very special circumstances that, I'm confident, do not apply here. (And when they do apply, Stata will automatically omit them for you anyway.) Your error was in using i.scan_nr#i.outcome_gr: it should have been i.scan_nr##i.outcome_gr.

    Comment

    Working...
    X