Different LME outputs for "same" data

10 views (last 30 days)
Francesca LoFaro
Francesca LoFaro on 20 May 2024
Commented: Peter Perkins on 29 May 2024
Me and my advisor were both working with the same dataset, but I had preemptively filtered mine so there were no table rows where the main variable of interest was NaN. We both ran the same LME (using the fitlme) function, but got slightly different results. Matlab's write-up of this function, and our understanding of it, is that it censors out the missing data and indeed we saw that we had the same number of observations included in both our models despite my advisor's table having more rows (that include the NaNs); this is as we expect. But then why were the model fit statistics and fixed effects coefficients slightly different? Most differences were very very small with the exception of one fixed effects coefficient that was drastically different.
The model would be something like this 'outcome ~ 1 + A + B*C + (1 + A + B*C | subjectID)' and the NaNs I preemtively filtered were part of the outcome variable where A, B, and C would have actually had data.
(I did re-create both of these results on my own computer over and over again with the only change being my own deletion of the NaN rows).
  2 Comments
Francesca LoFaro
Francesca LoFaro on 20 May 2024
As an update, we still have not figured out why this is happening but it seems related to the order of elements in the table (though that doesn't statistically make any sense).
Peter Perkins
Peter Perkins on 29 May 2024
A guess: your data are insufficient to make good estimates for your model, and a different order of data, or different platforms leads to slightly different results, except for one very unstable parameter estimate. You have to remember that these are complicated optimization problems. There are a LOT of knobs you can turn for this function. convergence tolerance might be one place to start, and probably display the iterations to see what's happening.

Sign in to comment.

Answers (0)

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!