# Should we always calculate the z in a confidence interval as 1 - (alpha/2)?

I'm currently beginning my studies in statistics and all of the examples of confidence interval questions I studied used (let's assume a 95% confidence interval) as a z formula z = 1 - (0.05/2), which would result in 0.975 and then using a z-table in 1.96. The thing is, is the alpha always divided by 2 or are all the examples I studied using a two sided distribution?

When you do two-sided testing, you have to allocate probability to both tails. You pick $$0.975$$ because $$2.5\%$$ goes up high, and $$2.5\%$$ goes down low.
• You're saying that there will be situations where the confidence interval actually is not two-sided? Can you please give me a link to an example or something? I could only find confidence intervals examples where z = 1 - (alpha/2). I thought it was because since there's a lower and upper limit in a confidence interval, you always divided the alpha by 2. So a 95% confidence interval would always have a Z-value of 1.96. Jul 23, 2020 at 22:05
• Thank you! This was really helpful! Don't now if you use python, but do you have any idea why any of the confidence interval packages and metrics don't allow us to choose whether it is one-sided or two-sided? Somes examples: statsmodels.org/stable/generated/… and scipy.stats.norm.interval() Jul 24, 2020 at 11:30