Weighted logit by hand to compare with glm() method