fitglme error says data is not full rank, but it is.

43 ビュー (過去 30 日間)
Luis J Gilarranz
Luis J Gilarranz 2020 年 10 月 6 日
コメント済み: Haidong Zhao 2022 年 3 月 9 日
Hi,
I'm trying to fit a glme to this data (there are over 600 rows).
The line of code looks like this:
glme = fitglme(TABLE,'X ~ A + B + C + D + E + F + G + H + I + J + K + (1|ID)','Distribution','Binomial')
It returns the following error:
Fixed Effects design matrix X must be of full column rank.
However, when I check the rank of the matrix, it is full rank:
>> test=table2array(TABLE);
>> rank(test)
ans =
13
>> size(test,2)
ans =
13
So I'm quite puzzled, it is the first time I try a glme using Matlab instead of R...

採用された回答

Jeff Miller
Jeff Miller 2020 年 10 月 6 日
I'm guessing: (1) your ID column is a unique identifier rather than an actual numerical predictor value, and (2) you only have one row for each value of ID.
If those two guesses are right, then you should omit the (1|ID) term from the model. That term tells fitglme to set up dummy variables to code that column, and the predictor matrix with these dummy variables is not full rank if you only have one row for each value of ID.
HTH
  4 件のコメント
Luis J Gilarranz
Luis J Gilarranz 2020 年 10 月 12 日
That seems to be the issue. It works now. Thanks a lot.
Haidong Zhao
Haidong Zhao 2022 年 3 月 9 日
Hi Luis
I have a similar problem when running fitglme. how do you please fix thi problem? Thanks.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by