Suppose we have data set $X$ with $20$ observations. A confidence interval for the mean $\mu$ is always the same no matter what hypothesis we test? So if we test $H_a: \mu < \mu_0$, $H_a: \mu \neq \mu_0$ or $H_a: \mu > \mu_0$, the confidence interval will be the same?
-
1$\begingroup$ There's some typo in your question - what's $H_0$ & what's $H_a$? $\endgroup$– Scortchi - Reinstate Monica ♦Jan 9, 2013 at 20:44
-
1$\begingroup$ @Scortchi I believe $H_0:\, \mu=\mu_0$, and the OP is talking about two one-sided and one two-sided alternatives. $\endgroup$– chlJan 9, 2013 at 21:27
-
1$\begingroup$ I don't understand your question. It is possible to make confidence intervals that don't match hypothesis tests. EG, you can test if $\mu<\mu_0$, but make a standard CI that goes from 2.5% to 97.5%. Alternatively, you could make a CI that goes from $-\infty$ to 95%, & do a 2-sided hypothesis test. So, it's possible to have a mismatch b/t your CI & your hypothesis test, is that what you want to know? $\endgroup$– gung - Reinstate MonicaJan 9, 2013 at 22:48
2 Answers
Yes it will. Testing hypotheses & calculating confidence intervals are different things. There's a relation between them: if you obtain a 95% confidence interval of $\left(\mu_{\textrm{low}},\mu_{\textrm{high}}\right)$ it means that if you were to carry out a two-sided hypothesis test with a null hypothesis that $\mu=\mu_{\textrm{low}}$ or $\mu=\mu_{\textrm{high}}$ the p-value would be 5%.
-
$\begingroup$ I disagree. I think similarly to @chl that the associated confidence interval is either two-sided, left-sided, or right-sided according to the alternative hypothesis (as with the
alternative
argument of thebinom.test()
R function) $\endgroup$ Jan 9, 2013 at 22:36 -
$\begingroup$ @StéphaneLaurent What I said goes, mutatis mutandis, for one-sided CIs. But I was interpreting the question in the same way as gung; perhaps what you're saying is what the OP really wanted to know. $\endgroup$ Jan 9, 2013 at 23:42
There are different types of confidence intervals. Intro stats classes tend to teach the simplest which just puts half of alpha on each side and usually creates a symmetric interval (at least for the simple cases in intro stat classes).
In theory you can even create a confidence interval that does not include the estimate from the sample (though there are not many cases where that would be useful).
Some statistical software packages will compute a one-sided confidence interval when you use a one sided alternative hypothesis for the test. I have also seen cases where if a one-sided test is done for a test of hypothesis then the confidence interval computed uses twice the alpha, i.e. a 5% level of the test and follow-up with a 90% (rather than 95%) confidence interval so that the test and interval match (at least on the interesting side).