Articles & Guides › Articles › Biostatistics & Public Health
Confidence intervals, statistical tests and correlation
How to read a confidence interval against the null value for ratios and differences and what makes it wider or narrower, how to choose between t-tests, ANOVA, chi-square and nonparametric tests from the type of outcome and the number of groups, and how correlation coefficients and regression models are interpreted.
Biostatistics & Public Health · 6 min read · Reviewed 2026-11-17
A p-value says whether a result is likely to be due to chance; a confidence interval also says how big the effect might be. Reading research well means reading confidence intervals at a glance, picking the right statistical test from a one-line description of a study, and interpreting a correlation coefficient. This article covers all three.
Key points
- A 95% confidence interval is the range of values reasonably compatible with the data; for a mean it is about the mean ± 1.96 × SEM.
- For ratios (relative risk, odds ratio, hazard ratio) the null value is 1; for differences it is 0. An interval that excludes the null value means p < 0.05.
- Intervals narrow with larger samples and less variability, and widen with a higher confidence level; a wide interval spanning no effect and a large effect is inconclusive, not negative.
- t-tests compare two means, ANOVA compares three or more means, chi-square compares proportions, and rank-based tests handle ordinal or skewed data.
- The correlation coefficient r runs from −1 to +1, its size gives strength and its sign direction; r² is the share of variation explained, and correlation doesn't prove causation.
Confidence intervals
What a confidence interval is
A 95% confidence interval (CI) is a range that, if a study were repeated many times, would contain the true population value in 95% of the repetitions. In practice it is the range of values reasonably compatible with the data. For a mean, the 95% CI is about the mean ± 1.96 × SEM[1,2].
Strictly, the "95%" describes the method, not one particular interval: 95% of intervals calculated this way contain the truth. For practical purposes, the key question is whether the interval includes the null value.
Using a CI to judge significance
First find the value that would mean "no effect," the null value.
| Measure | Null value | Significant at p < 0.05 if the 95% CI |
|---|---|---|
| Ratios: relative risk, odds ratio, hazard ratio | 1 | excludes 1 |
| Differences: difference in means, absolute risk difference | 0 | excludes 0 |
An odds ratio of 1.45 with a 95% CI of 0.92 to 2.28 isn't significant: the interval excludes 0, but that is irrelevant for a ratio, and it includes 1. A relative risk of 0.80 with a CI of 0.68 to 0.94 is significant, and it says the true reduction in risk is plausibly anywhere from 6% to 32%[1].
Comparing two groups' intervals
If the 95% CIs of two group means don't overlap, the groups differ significantly. If they do overlap, the difference may or may not be significant, and a test of the difference itself is needed.
What changes the width
| Change | Effect on width |
|---|---|
| Larger sample | Narrower, because the SEM shrinks |
| More variability (a larger SD) | Wider |
| Higher confidence level, such as 99% | Wider: more certainty needs a wider range |
| Lower confidence level, such as 90% | Narrower |
Reading the whole interval
A confidence interval shows clinical as well as statistical significance. An interval that excludes the null value but lies entirely within a clinically trivial range shows a real but unimportant effect. A wide interval that includes both no effect and a large benefit means the study is inconclusive, often because it was too small; it isn't evidence of no effect[1].
Choosing a statistical test
Two questions decide the test: what type is the outcome, continuous or categorical? And how many groups are compared, and are they independent or paired?[3]
| Data | Test | Example |
|---|---|---|
| Continuous outcome, 2 independent groups | Two-sample (unpaired) t-test | Mean hemoglobin in iron versus placebo groups |
| Continuous outcome, the same people measured twice, or matched pairs | Paired t-test | Each patient's blood pressure before and after treatment |
| Continuous outcome, 3 or more groups | Analysis of variance (ANOVA) | Mean weight loss on 3 diets |
| Categorical outcome (proportions), 2 or more groups | Chi-square (χ²) test | Proportion with wound infection after two surgical techniques |
| Categorical outcome with small expected counts (under 5 in a cell) | Fisher exact test | A rare side effect in a small trial |
| Categorical outcome, paired | McNemar test | The same patients' results before and after an intervention |
| Ordinal or skewed continuous outcome, 2 groups | Mann-Whitney U (Wilcoxon rank-sum) | Pain scores in two groups |
| Ordinal or skewed, paired | Wilcoxon signed-rank test | Pain scores before and after in the same patients |
| Ordinal or skewed, 3 or more groups | Kruskal-Wallis test | |
| Relationship between two continuous variables | Pearson correlation, or Spearman for ranks and ordinal data | Age and systolic blood pressure |
| Time-to-event data | Log-rank test, Cox regression | Survival curves |
A simple summary: t-tests compare two means, ANOVA compares three or more means and chi-square compares proportions. Running several t-tests instead of one ANOVA for three or more groups inflates the chance of a type I error.
For example, comparing the proportion of patients readmitted within 30 days after weekday versus weekend discharge calls for a chi-square test: the outcome is yes or no, and there are two independent groups. Comparing length of stay in days between the same two groups calls for a two-sample t-test, or a Mann-Whitney U test if the stays are skewed, as they usually are.
Correlation and regression
The correlation coefficient
The correlation coefficient (r) measures the strength and direction of a linear relationship between two continuous variables, from −1 to +1[4].
- r = +1: a perfect positive linear relationship, where one rises as the other rises.
- r = −1: a perfect negative linear relationship, where one falls as the other rises.
- r = 0: no linear relationship, although there could still be a curved one.
- The closer r is to −1 or +1, the stronger the relationship; the sign gives only the direction. An r of −0.8 is stronger than one of +0.5.
The coefficient of determination, r², is the share of the variation in one variable explained by its linear relationship with the other. If age and systolic blood pressure correlate with r = 0.5, then r² = 0.25: age explains about a quarter of the variation in blood pressure, and three quarters comes from other things.
Correlation isn't causation: a strong correlation can come from confounding, reverse causation or chance.
Regression
Regression fits an equation that predicts an outcome (the dependent variable) from one or more predictors[4].
- Linear regression handles a continuous outcome, such as predicting blood pressure from age and weight.
- Logistic regression handles a yes-or-no outcome and produces odds ratios adjusted for the other variables.
- Cox proportional hazards regression handles time-to-event outcomes and produces hazard ratios.
- Multivariable regression adjusts for several confounders at once, though only for those that were measured.
Common confusions
- The wrong null value: a ratio's interval must exclude 1, not 0. An interval of 0.9 to 2.2 for a relative risk isn't significant.
- Overlapping intervals don't prove there is no difference; non-overlapping ones do show a difference.
- Paired versus two-sample t-test: the same people measured twice versus two different groups.
- Strength versus direction: the size of r gives strength and the sign gives direction, so −0.9 is a very strong relationship.
References
- Gardner MJ, Altman DG. Confidence intervals rather than P values: estimation rather than hypothesis testing. Br Med J (Clin Res Ed). 1986;292(6522):746-750. doi:10.1136/bmj.292.6522.746 Link ↩
- Altman DG, Bland JM. Standard deviations and standard errors. BMJ. 2005;331(7521):903. doi:10.1136/bmj.331.7521.903 Link ↩
- Celentano DD, Szklo M. Gordis Epidemiology. 6th ed. Elsevier; 2019. ↩
- Rothman KJ. Epidemiology: An Introduction. 2nd ed. Oxford University Press; 2012. ↩