Error in StandardGe​neralizedL​inearMixed​Model/vali​dateyRange

조회 수: 3 (최근 30일)
Laurie
Laurie 2018년 1월 31일
답변: Paul 2020년 7월 20일
I'm trying to fit a GLME model to proportion data. There are no NaNs, the response variable is in [0 1], and manually computing counts shows a vector of integers. Yet, running the following command generates an error in StandardGeneralizedLinearMixedModel/validateyRange on line 666:
weigths = ones(size(binomialsize));
fitglme(data2, 'y ~ x + (x|ID)','Distribution','binomial',...
'BinomialSize',binomialsize, 'Weights',weigths)
The full error is as follows:
Error using classreg.regr.lmeutils.StandardGeneralizedLinearMixedModel/validateyRange (line 666)
For Binomial distribution, the responses must be proportions, 'Weights' and 'BinomialSize' must be positive integers and the product of responses, 'Weights' and
'BinomialSize' must be integers.
Error in classreg.regr.lmeutils.StandardGeneralizedLinearMixedModel (line 4193)
validateyRange(sglme,sglme.y,binomialsize,weights,distribution);
Error in GeneralizedLinearMixedModel/fitStandardLMEModel (line 1317)
slme = classreg.regr.lmeutils.StandardGeneralizedLinearMixedModel(X,model.y,Zs,Psi,model.FitMethod,dofit,dostats,args{:});
Error in GeneralizedLinearMixedModel/fitter (line 891)
model.slme = fitStandardLMEModel(model);
Error in classreg.regr.FitObject/doFit (line 94)
model = fitter(model);
Error in GeneralizedLinearMixedModel.fit (line 2411)
model = doFit(model);
Error in fitglme (line 389)
glme = GeneralizedLinearMixedModel.fit(T,formula,varargin{:});
Manually running lines 663-667 in StandardGeneralizedLinearMixedModel using y, weights, and binomialsize as imputed to fitglme does not generate the error, in accordance with the above statement that the response variable should be valid.
What is going on? The response variable seems fine. I'm using Statistics and Machine Learning Toolbox Version 11.1 (R2017a)
  댓글 수: 2
Bernhard Suhm
Bernhard Suhm 2018년 2월 1일
Provide a sample of your data, see these instructions .
Naya Polychroni
Naya Polychroni 2020년 2월 12일
Hi Laurie,
Did you manage to solve this? I am having the same problem.

댓글을 달려면 로그인하십시오.

답변 (3개)

asc
asc 2018년 7월 4일
Were you able to run fitglme without error after this?

Naya Polychroni
Naya Polychroni 2020년 2월 12일
Hi Laurie,
Did you manage to solve this? I am having the same problem.
  댓글 수: 1
Paul
Paul 2020년 7월 20일
Solved. The response vector should not be proportions, it should be number of successes. The Matlab documentation is incorrect on this point, as is the code that produces the error.

댓글을 달려면 로그인하십시오.


Paul
Paul 2020년 7월 20일
Solved. The response vector should not be proportions, it should be number of successes. The Matlab documentation is incorrect on this point, as is the code that produces the error.

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by