Standard Error used in Hypothesis Testing and Confidence Interval construction In the excellent Practical Statistics for Medical Research Douglas Altman writes in page 235: 
 "Because the standard error used for calculating the confidence interval differs from that used in hypothesis testing it can occasionally happen[...] that the confidence interval excludes the value specified under the null hypothesis when the hypothesis gives a non-significant result"
Could someone comment why the SE's are different in hypothesis testing than in confidence intervals construction and which formulas are appropriate in each case?
 A: One simple example of this is doing a one sample test of proportions using the normal approximation.  When doing a test of significance we have a null hypothesis that the proportion is a specific value, so we use that number in the standard error formula (since we do not know the true proportion and assume the null is true till proven otherwise).  But when doing a confidence interval we do not assume anything about the proportion and generally use the proportion estimated from the sample in the standard error formula.  Occassionally this can make the 2 disagree.
Similarly when comparing 2 proportions the standard error in hypothesis testing uses a composite proportion assuming that the 2 proportions are equal, but the confidence interval does not assume equality and combines the 2 proportions in a different way.
A: http://apcentral.collegeboard.com/apc/members/courses/teachers_corner/49013.html
The above link has some detailed explanation on why we calculate SE separately for CIs and Hypothesis testing of proportions..
