glmfit stats error

5 views (last 30 days)
Patrick Sagui
Patrick Sagui on 21 May 2011
I have been using glmfit to perform a logistic regression. It was working for several days, but now something has changed and when I request stats back from the fit it returns an error. What am I doing wrong in the following example:
x = [2100 2300 2500 2700 2900 3100 3300 3500 3700 3900 4100 4300]';
y = [1 0 0 1 1 0 0 0 0 1 0 1]';
This line works:
[b,dev] = glmfit(x,y,'binomial','link','logit');
This line fails:
[B,dev,stats]=glmfit(x,y,'binomial','link','logit');
??? Error using ==> beta
Too many input arguments.
Error in ==> glmfit at 377
anscresid = beta(t,t) * ...
I am sure it is a simple issue but I really don't know what I changed or what is going wrong to cause this issue. Any guidance would be very helpful. Thanks

Accepted Answer

Daniel Shub
Daniel Shub on 21 May 2011
It works fine on my machine. I would try:
which beta
It should return something like: .../toolbox/matlab/specfun/beta.m
It is possible you have added a function beta to your path which overloads the builtin function.

More Answers (1)

Patrick Sagui
Patrick Sagui on 21 May 2011
Thank you very much, this was the problem.

Community Treasure Hunt

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

Start Hunting!