As Skipper and I discussed this cannot work, because GLM doesn't know
what the number of observations is.
Below is a version that expands to the full number of observations,
which is the only way that Logit knows how to handle (currently).
Josef
-------------------------
# -*- coding: utf-8 -*-
"""
Created on Thu May 09 12:16:40 2013
Author: Josef Perktold
"""
import numpy as np
import statsmodels.api as sm
data = np.array([[1.6907, 59, 6],
[1.7242, 60, 13],
[1.7552, 62, 18],
[1.7842, 56, 28],
[1.8113, 63, 52],
[1.8369, 59, 53],
[1.861, 62, 61 ],
[1.8839, 60, 60]])
count1 = data[:,2]
count2 = data[:,1] - data[:,2]
x1 = np.repeat(data[:,0], count1.astype(int))
y1 = np.ones(len(x1))
x2 = np.repeat(data[:,0], count2.astype(int))
y2 = np.zeros(len(x2))
endog = y = np.concatenate((y1, y2))
x = np.concatenate((x1, x2))
exog = sm.add_constant(x)
print endog.shape, exog.shape
model = sm.GLM.from_formula('y~x', data = {'y':y, 'x':x},
family=sm.families.Binomial())
print sm.GLM(endog, exog, family=sm.families.Binomial()).fit().bse
print model.fit().bse
print sm.Logit(endog, exog).fit().bse
-----------------------