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

4 visualizaciones (últimos 30 días)
Laurie
Laurie el 31 de En. de 2018
Respondida: Paul el 20 de Jul. de 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 comentarios
Bernhard Suhm
Bernhard Suhm el 1 de Feb. de 2018
Provide a sample of your data, see these instructions .
Naya Polychroni
Naya Polychroni el 12 de Feb. de 2020
Hi Laurie,
Did you manage to solve this? I am having the same problem.

Iniciar sesión para comentar.

Respuestas (3)

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

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

Iniciar sesión para comentar.


Paul
Paul el 20 de Jul. de 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.

Categorías

Más información sobre Dimensionality Reduction and Feature Extraction en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by