Is there a formula to properly calculate the confidence interval when you're only given alpha and sample data?
Thanks!
Is there a formula to properly calculate the confidence interval when you're only given alpha and sample data?
Thanks!
Copyright © 2021 JogjaFile Inc.
In order to correctly construct confidence interval, first of all, you need a "pivot" T such that
For example, $T=\frac{\bar{x}-\mu}{\sigma/\sqrt{n}}$ is a pivot, and $T$~$N(0,1)$ regardless of the value of $\mu$ (if the sample size is large enough, say >30).
In this case, $P(a\leq T \leq b)=1-\alpha$, where $a=-Z_{\frac{\alpha}{2}}$ and $b=Z_{\frac{\alpha}{2}}$. So the "natural" confidence interval is $(\bar{x}-Z_{\frac{\alpha}{2}}(\frac{\sigma}{\sqrt{n}}),\bar{x}+Z_{\frac{\alpha}{2}}(\frac{\sigma}{\sqrt{n}}))$, where $Z_{\frac{\alpha}{2}}$ is such that $P(z>Z_{\frac{\alpha}{2}})=\frac{\alpha}{2}$.
$Z_{\frac{\alpha}{2}}$ can be calculated using the R command $qnorm(1-\frac{\alpha}{2})$
This is just an example when we know the pivot has the normal distribution. There exist other cases where the pivot we constructed doesn't have a normal distribution, and the calculation in that case would be a little bit different than this. I don't think there exists a formula that can be applied to any situation.
Hope that helps!