I refer to the site Interval Estimation for a Binomial Proportion Using glm in R, getting the ”asymptotic” 95%CI. I think binomial link doesn’t have “identity”, but the following program got the answer. Why? If you know that, please give me some advice.
This example, n=10, x=2, asymptiotic 95%CI
binom.ci<-function(x,n,alpha = 0.05,link="logit"){
z<-qnorm(1-alpha/2)
family<-binomial(link=link)
fit<-summary(glm(cbind(x,n-x)~1,family=family))
est<-fit$coef[,"Estimate"]
se<-fit$coef[,"Std. Error"]
family$linkinv(est+c(-z,z)*se)
}
binom.ci(x=2,n=10,link="identity")
# [1] -0.04791801 0.44791801