fitglme gives rank deficit error while fitglm does not.

조회 수: 7 (최근 30일)
Mostafa
Mostafa 2022년 4월 13일
답변: Mostafa 2022년 4월 14일
Dear all,
When I try to fit a model using fitglme with a model specification extracted from stepwise regression plus a random effect (1|ID), I receive the following error message: "Fixed Effects design matrix X must be of full column rank."
I removed the random effect from the formula, but the error still occurred while fitglm returns no error.
If fitglme without random effects must be the same as fitglm, then there must be a problem with fitglme as this error has been reported by others here and here.
Your advice on dealing this error would be greatly appriciated.
The second question is that if there is any way to include the random effect directly in the stepwiseglm.
Thanks in advance!

답변 (1개)

Mostafa
Mostafa 2022년 4월 14일
I figured out why a model specification worked in fitglm, but not in fitglme even without random effect. Many others also had the same problem of rank deficit error in Fitlme and their questions were not answered.
The problem is that glmfit and lmfit drop the problematic terms automatically but glmfite and lmfite do not.
So the solution will be to run the same model specification without random effects in glmfit or lmfit and see if it works. If this is the case, then at least one term will have been dropped whose estimate is 0 and whose tstat and pValue equal NaN.
That term is the problematic one and you need to drop it manually before running fitglme or lmfite.

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by