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

4 Ansichten (letzte 30 Tage)
Laurie
Laurie am 31 Jan. 2018
Beantwortet: Paul am 20 Jul. 2020
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 Kommentare
Bernhard Suhm
Bernhard Suhm am 1 Feb. 2018
Provide a sample of your data, see these instructions .
Naya Polychroni
Naya Polychroni am 12 Feb. 2020
Hi Laurie,
Did you manage to solve this? I am having the same problem.

Melden Sie sich an, um zu kommentieren.

Antworten (3)

asc
asc am 4 Jul. 2018
Were you able to run fitglme without error after this?

Naya Polychroni
Naya Polychroni am 12 Feb. 2020
Hi Laurie,
Did you manage to solve this? I am having the same problem.
  1 Kommentar
Paul
Paul am 20 Jul. 2020
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.

Melden Sie sich an, um zu kommentieren.


Paul
Paul am 20 Jul. 2020
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.

Community Treasure Hunt

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

Start Hunting!

Translated by