Filter löschen
Filter löschen

Problem rank design matrix glme

1 Ansicht (letzte 30 Tage)
Hans van der Horn
Hans van der Horn am 6 Jan. 2021
Dear all,
I encounter a problem with fitglme.
I'm trying to fit the following model:
y ~ age + sex + education + g2*time + g3*time + g4*time + (1|subject)
The first group (g1) only has one timepoint instead of 2 for the other groups (so I use this one as a reference, and use the other groups dummycoded), so I tried filling in NaN or just 0 for Time for that group.
However, Matlab keeps giving me the error that the design matrix is not full rank during validation of inputs.
This also happens when I simply use groups as one column vector without seperately dummy coding them, and doing: y ~ age + sex + education + group*time + (1|subject)
How would you approach this problem? Can I still put everything in 1 model?
Thanks very much.
  2 Kommentare
John D'Errico
John D'Errico am 6 Jan. 2021
You cannot use a model with 3 time variables like that. If you did, you could just combine them all into one time vector, with one coefficient. There is only one piece of information there to be estimated.
Filling in a point with NaN essentially just eliminates that point. And using 0 for time for some points arbitrarily is little better.
But sadly, it is difficult to really know what you did, and why the problem is rank deficient, without actually seeing what you did. Describing vaguely what you did is not enough.
Hans van der Horn
Hans van der Horn am 6 Jan. 2021
Thanks for your answer John. What I would like to do is fit a model with 4 groups and 2 time points, and one of the groups has no second time point. In addition I would like to add 3 covariates. How would you approach this?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by