How to calculate a confidence interval using glmfit

4 views (last 30 days)
I have been using glmfit to calculate the p values for a set of data with binomial distribution and I would like to add the confidence interval for completeness. This is an example of how I have been using the glmfit function.
[b,dev,stats]= glmfit([age ap2 mnep dias mdias],VPind,'binomial','link','logit');
My knowledge of statistics is very limited, but from what I have been able to learn so far it seems that using the standard error of the estimate of b (stats.se), you should be able to calculate the confidence interval but I am stuck? Can anyone offer some direction? Thanks-

Accepted Answer

Daniel Shub
Daniel Shub on 26 Aug 2011
The standard error (SE) can be used to find the range needed to achieve a confidence interval (CI). Specifically, for any CI between 0 and 1, the upper and lower bounds are:
[-norminv((CI+1)/2), norminv((CI+1)/2)]*SE
It turns out that +/-2 SE is approximately the 95% confidence interval.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!