library(boot)

y <- cbind(rpois(20,20), rpois(20,100))
p <- y[,1]/(y[,1]+y[,2])

fit.1 <- glm(y ~ 1, family=binomial)
fit.1.pre <- predict(fit.1, se=TRUE, type="response")
fit.1.se <- fit.1.pre$se.fit
fitted(fit.1)

fit.2 <- glm(p ~ 1, family=binomial, weights=(y[,1]+y[,2]))
fit.2.pre <- predict(fit.2, se=TRUE, type="response")
fit.2.se <- fit.2.pre$se.fit
fitted(fit.2)

fit.3 <- glm(logit(p) ~ 1, family=gaussian)
fit.3.pre <- predict(fit.3, se=TRUE, type="response")
fit.3.se <- inv.logit(fit.3.pre$se.fit)
inv.logit(fitted(fit.3))

