Problem rank design matrix glme

3 ビュー (過去 30 日間)
Hans van der Horn
Hans van der Horn 2021 年 1 月 6 日
コメント済み: Hans van der Horn 2021 年 1 月 6 日
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 件のコメント
John D'Errico
John D'Errico 2021 年 1 月 6 日
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 2021 年 1 月 6 日
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?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeChemistry についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by