news:kvhmn9$pjr$1...@newscl01ah.mathworks.com...
You do need to flatten out your arrays of values and counts into a matrix of
individual cases. Unless your dataset is really big, this shouldn't be a
problem. Something like this would work:
%%
x = [2100 2300 2500 2700 2900 3100 ...
3300 3500 3700 3900 4100 4300]';
n = [48 42 31 34 31 21 23 23 21 16 17 21]';
y = [1 2 0 3 8 8 14 17 19 15 17 21]';
b = glmfit(x,[y n],'binomial','link','probit');
%%
M = size(x,1);
xflat = [];
yflat = [];
for m=1:M
xflat = [xflat; repmat(x(m,:),n(m),1)];
yflat = [yflat; zeros(n(m)-y(m),1); ones(y(m),1)];
end
% bflat should be equal to b
bflat = glmfit(xflat,yflat,'binomial','link','probit');
%%
p = glmval(b,xflat,'probit');
[fpr,tpr] = perfcurve(yflat,p,1);
plot(fpr,tpr);
Ilya