🔑 Key Words First
glossaryPlain-language glossary
| Word | Plain meaning |
|---|---|
| Population | The whole group you want to learn about |
| Sample | The smaller group you actually measure |
| Inference | Using a sample to draw conclusions about the population |
| Sampling error | Natural difference between a sample result and the true population value |
| Mean | The average |
| Standard deviation (SD) | The typical distance of values from the mean |
| Standard error (SE) | How much a sample's result would wobble if you repeated the study |
| Confidence interval (CI) | A range likely to contain the true population value |
| Confidence level | How often such ranges capture the truth (usually 95%) |
| Z score | Number of SDs from the mean; used as the multiplier in intervals |
| Null hypothesis | The 'nothing is going on' claim: any finding is chance |
| Alternative hypothesis | The claim that something real is going on |
| One-tailed test | Tests for a difference in one direction only |
| Two-tailed test | Tests for a difference in either direction |
| Test statistic | A number computed from the data that measures how far results are from the null hypothesis |
| p-value | Chance of results at least this extreme if the null hypothesis were true |
| Alpha (α) / significance level | The p-value cutoff you set in advance, usually 0.05 |
| Statistically significant | A result with p-value at or below alpha |
| Type I error | Concluding there is an effect when there is none (false alarm) |
| Type II error | Missing a real effect (missed finding) |
| Beta (β) | Chance of a type II error |
| Power | Chance of detecting a real effect (1 − β) |
| Effect size | How big the difference or relationship actually is |
| Nominal / ordinal / interval data | Categories / ranked categories / numbers with equal gaps |
| Correlation coefficient (r) | A number from −1 to +1 showing the strength and direction of a straight-line link |
| Scatterplot | A graph with one dot per person, plotting two measurements |
| t-test | Compares the means of two groups |
| Paired (matched) t-test | Compares two linked measurements, such as before and after in the same people |
| ANOVA (analysis of variance) | Compares the means of three or more groups |
| F statistic | The test number produced by ANOVA |
| Chi-square test | Compares counts across categories |
| Regression | Predicts one measurement from another using a fitted line |
| Relative risk (RR) | Risk in exposed divided by risk in unexposed |
| Odds ratio (OR) | Ratio of exposure odds in cases to controls |
🧭 Big Picture
overview- Descriptive statistics summarize the people you measured
- Inferential statistics ask what the sample says about everyone else
- Core problem:
- Samples differ from the population by chance
- Is the finding real, or just luck of the draw?
- Tools in this note:
- Confidence intervals show a plausible range
- Hypothesis tests judge if chance alone could explain the result
- Statistical tests are chosen by the type of data
Everyday analogy: tasting soup
- One spoonful is the sample; the whole pot is the population.
- Spoonfuls vary a little, so one taste is only an estimate.
- A confidence interval is the range of flavors the pot probably has.
- A hypothesis test asks: is this soup truly saltier than the usual recipe, or just a salty spoonful?
📏 Standard Error and Confidence Intervals
estimation- Where this fits: a sample result is an estimate, so we attach a margin of uncertainty
SD versus standard error
| Measure | Describes | Formula | Shrinks with bigger sample? |
|---|---|---|---|
| SD | Spread of individual values in one sample | From the data | No |
| Standard error | Spread of the sample mean across repeated samples | SE = SD ÷ √n | Yes |
- Larger SD gives larger SE
- Larger sample gives smaller SE
- To halve the SE, the sample must be four times larger
Building a confidence interval
Take the study result→Multiply SE by Z→Add and subtract
- CI = result ± Z × SE
- Z for 95% confidence ≈ 1.96 (often rounded to 2)
- Z for 99% confidence ≈ 2.58
Worked example
- Sample of 64 patients; mean cholesterol 200 mg/dL; SD 32
- SE = 32 ÷ √64 = 32 ÷ 8 = 4
- 95% CI = 200 ± 1.96 × 4 ≈ 200 ± 7.8
- About 192 to 208
- 99% CI = 200 ± 2.58 × 4 ≈ 200 ± 10.3
- About 190 to 210
- With 256 patients and the same SD: SE = 2, so the 95% CI narrows to about 196 to 204
| If this changes | Interval width | Precision | Confidence |
|---|---|---|---|
| Higher confidence level (99% instead of 95%) | Wider | Lower | Higher |
| Larger sample | Narrower | Higher | Same |
| Larger SD (noisier data) | Wider | Lower | Same |
Correct meaning of a 95% CI
- If the study were repeated many times, about 95% of such intervals would contain the true value
- The sample result sits at the center of its own interval
- A narrower interval means a more precise estimate
Reading intervals for ratios and differences
| Measure | 'No effect' value | CI crossing it means |
|---|---|---|
| Relative risk, odds ratio | 1.0 | Not statistically significant |
| Difference between means or risks | 0 | Not statistically significant |
- Example: RR 1.8 with CI 1.2 to 2.6
- Interval excludes 1.0, so significant increase
- About 80% higher risk
- Example: RR 1.4 with CI 0.9 to 2.1
- Interval includes 1.0, so not significant
- Example: RR 0.7 with CI 0.5 to 0.9
- Interval excludes 1.0, so significant protection
- 30% lower risk (1 − 0.7)
- Rule of thumb for comparing two group means: intervals that do not overlap indicate a significant difference
- Overlap usually means not significant, but a formal test is more exact
Why a CI beats a lone p-value
- It shows the size of the effect.
- It shows how precise the estimate is.
- It also shows significance, by whether it crosses the no-effect value.
Exam traps
- Higher confidence means a wider, less precise interval.
- A CI that contains 1.0 for a ratio is not significant.
- SE, not SD, goes into the CI formula.
⚖️ Hypothesis Testing Step by Step
decision rules- Where this fits: a test asks whether chance alone could plausibly explain the sample result
State question→Set null and alternative→Choose alpha→Collect data and run test→Compare p with alpha→Decide
Null and alternative hypotheses
| Hypothesis | Says | Example |
|---|---|---|
| Null (H0) | No effect or no difference; findings are due to chance | The new drug lowers blood pressure no more than placebo |
| Alternative (H1) | A real effect or difference exists | The new drug lowers blood pressure more than placebo |
- The null is built to be the claim researchers hope to disprove
- We try to reject the null, never to prove it
One-tailed versus two-tailed
| Type | Looks for | Null wording example |
|---|---|---|
| One-tailed | Difference in a single, pre-stated direction | The program does not lower the rate (any lower than the comparison) |
| Two-tailed | Difference in either direction | The two groups are equal |
- Two-tailed is the default when direction is not stated
- A one-tailed null is a one-direction statement of no effect
The p-value
- Computed from the data using the right test
- Definition: chance of a result at least this extreme if the null hypothesis were true
- Small p means the data would be surprising under the null
- Alpha is the cutoff chosen before the study; usually 0.05
- Decision rule:
- p ≤ alpha: reject the null (statistically significant)
- p > alpha: fail to reject the null (not significant)
- Example: p = 0.02 with alpha 0.05, so reject the null
- Example: p = 0.13 with alpha 0.05, so fail to reject the null
- Failing to reject means evidence is insufficient, not that the drug is useless
Everyday analogy: a courtroom
- The null hypothesis is 'innocent until proven guilty'.
- The data are the evidence.
- The verdict is 'guilty' (reject) or 'not guilty' (fail to reject).
- 'Not guilty' does not mean proven innocent.
What a p-value does and does not say
| It tells you | It does not tell you |
|---|---|
| Whether chance alone is an unlikely explanation | Probability that an individual patient will benefit |
| Statistical significance | Clinical importance or size of benefit |
| Fit with the decision rule | Probability that the null hypothesis is true |
Exam traps
- The null hypothesis is never 'accepted'; it is rejected or not rejected.
- A significant p-value does not mean a large or useful effect.
- If you do not reject the null, a type I error cannot occur.
- If you reject the null, a type II error cannot occur.
- Always read the p-value, not the test statistic, when deciding significance.
🚨 Errors and Statistical Power
decision risk- Where this fits: every test decision can still be wrong; there are two ways to be wrong
| Truth: effect is real | Truth: no real effect | |
|---|---|---|
| Test says significant (reject null) | Correct: power (1 − β) | Type I error (α) |
| Test says not significant (fail to reject) | Type II error (β) | Correct |
Type I error (alpha, false alarm)
- Rejecting a null that is actually true
- Claiming a drug works when it does not
- Probability = alpha, the chosen cutoff
- With alpha 0.05:
- 5 in 100 true nulls would be wrongly rejected
- 1 in 20
- With alpha 0.01: 1 in 100
- Conclusion is statistically significant but not real
Type II error (beta, missed finding)
- Failing to reject a null that is actually false
- Claiming a drug does not work when it does
- Chance is beta
- Cannot be read directly from the p-value
- Often caused by too small a sample
Power
- Definition: chance of detecting a real effect
- Power = 1 − β
- Usual goal: at least 80%
- Example: a researcher wants a 90% chance of detecting a true 30% risk reduction
- This is specifying power
| To raise power | Why it works |
|---|---|
| Increase sample size | Lowers the standard error |
| Target a larger effect | Big differences stand out from noise |
| Reduce variability (better measurement) | Less noise |
| Raise alpha (for example 0.10) | Easier to call significant, but more false alarms |
Smaller alpha→Fewer type I errors→More type II errors→Lower power
Everyday analogy: a smoke detector
- A very sensitive detector rarely misses a fire but often beeps for toast (more type I).
- A dull detector rarely false-alarms but may miss a fire (more type II).
- Power is how reliably it catches real fires.
Exam traps
- Type I = false positive; type II = false negative.
- Power and type II error move in opposite directions.
- A larger sample is the most common way to increase power.
- With a significance cutoff of 0.01, the chance of a type I error is 1 in 100.
📈 Correlation and Regression
relationships- Where this fits: when both measurements are numbers, we ask how they move together
Correlation coefficient (r)
- Ranges from −1 to +1
- Sign gives direction; size gives strength
- Looks only for straight-line relationships
| r value | Meaning | Scatterplot picture | Example |
|---|---|---|---|
| +1 | Perfect positive | Dots on a rising line | — |
| +0.7 | Strong positive | Tight upward band | Hours studied and exam score |
| +0.2 | Weak positive | Loose upward cloud | — |
| 0 | No linear link | Shapeless cloud | Shoe size and blood pressure |
| −0.7 | Strong negative | Tight downward band | Age and reaction speed |
| −1 | Perfect negative | Dots on a falling line | — |
- Positive: both rise together
- Negative: one rises as the other falls
- Further from zero means stronger link
Two kinds of correlation
| Test | Data type | Use |
|---|---|---|
| Pearson | Two interval or ratio variables | Straight-line relationship |
| Spearman | Two ordinal variables, or skewed numeric data | Rank-based relationship |
- r² shows the share of variation explained
- Example: r = 0.5 means 25% of the variation is shared
Regression
- Fits a line to predict one measurement from another
- Straight-line regression predicts a numeric outcome
- Logistic regression predicts a yes-or-no outcome
- Regression lets you adjust for several factors at once
Why correlation is not causation
- A link can be due to a third factor.
- Example: ice cream sales and drowning both rise in summer.
- A link can run the other direction.
- Only well-designed experiments can support causal claims.
Exam traps
- A correlation near zero does not prove there is no relationship; the link may be curved or masked by measurement error.
- The correlation number is not a p-value.
- Avoid answer choices that claim one variable causes the other.
🧪 Choosing the Right Statistical Test
algorithm- Where this fits: the type of data and number of groups decide the test
Decision path
Outcome is a category?→Yes→Chi-square
Outcome is a number, 2 groups?→Yes→t-test (paired if linked)
Outcome is a number, 3+ groups?→Yes→ANOVA
Two numbers, one per person?→Yes→Correlation
| Test | Groups / variables | Outcome data | Question answered |
|---|---|---|---|
| Pearson correlation | Two numeric variables | Interval or ratio | Is there a straight-line link? |
| Chi-square | Any number of groups | Nominal (counts) | Are the categories related? |
| t-test (unpaired) | Exactly 2 independent groups | Interval or ratio | Do two means differ? |
| Paired t-test | 2 linked measurements (before and after, spouses, matched pairs) | Interval or ratio | Do paired means differ? |
| One-way ANOVA | 3 or more groups, one grouping factor | Interval or ratio | Do any means differ? |
| Two-way ANOVA | Groups from 2 grouping factors | Interval or ratio | Do either factor or their combination matter? |
| Repeated-measures ANOVA | Same people measured 3 or more times | Interval or ratio | Do means change over time? |
t-test
- Compares two means
- Test statistic: t = difference in means ÷ standard error of the difference
- Unpaired: separate groups
- Paired: each person acts as their own control
ANOVA
- Produces an F statistic
- F = variation between groups ÷ variation within groups
- Significant result means at least one group differs
- It does not say which groups differ
- Follow-up comparisons identify the specific groups
- Why not many t-tests: repeated testing inflates type I error
Chi-square
- Tests whether two categorical variables are independent
- Compares observed counts with the counts expected if there were no link
- Works for 2×2, 2×3, 3×3 tables and larger
- Small expected counts: use an exact test instead
- Worked example: 120 patients, 60 per group
- Recovered: 42 on new treatment, 30 on placebo
- Total recovered = 72; not recovered = 48
- Expected if no effect: 36 recovered and 24 not in each group
- Chi-square = (42−36)²/36 + (18−24)²/24 + (30−36)²/36 + (30−24)²/24
- = 1 + 1.5 + 1 + 1.5 = 5.0
- Critical value for 1 degree of freedom at 0.05 is 3.84
- 5.0 is larger, so p < 0.05 and the null is rejected
Default pairings to remember
- Two numbers per person: correlation.
- Two categories: chi-square.
- A category plus a number: t-test or ANOVA.
Matching situations to tests
| Situation | Test | Why |
|---|---|---|
| Compare blood sugar of husbands and wives | Paired t-test | Spouses are linked pairs |
| Compare sick-leave yes or no across 3 shifts | Chi-square | Two categorical variables |
| Study hours versus exam score | Pearson correlation | Two numeric variables |
| Testosterone in boys with or without same-sex siblings | Unpaired t-test | Two groups, numeric outcome |
| Quality of life scores after 3 different treatments | One-way ANOVA | Three groups, numeric outcome |
| Blood pressure before and after a drug in the same patients | Paired t-test | Linked measurements |
| Effect of treatment and training on task time | Two-way ANOVA | Two grouping factors, numeric outcome |
| Cancer versus no cancer by exposure group (counts) | Chi-square | Two categorical variables |
Exam traps
- Linked or before-and-after data need a paired test.
- Counting people in categories always points to chi-square.
- Three or more means need ANOVA, not repeated t-tests.
🔗 Linking Tests to Study Designs
application- Where this fits: choose the study measure by design, then the test by data type
| Design | Natural measure | Why | Usual test for significance |
|---|---|---|---|
| Cohort (follow forward) | Relative risk | Incidence in each group is available | Chi-square or CI crossing 1 |
| Case-control (start from disease) | Odds ratio | Incidence cannot be found | Chi-square or CI crossing 1 |
| Randomized trial, binary outcome | Relative risk, ARR, NNT | Event rates known | Chi-square |
| Randomized trial, numeric outcome | Difference in means | Measured on a scale | t-test or ANOVA |
| Cross-sectional, two variables | Prevalence, correlation | One time point | Chi-square or correlation |
- Example: 100 heart attack patients compared with 100 without, asking about commuting time
- Starts from disease, so case-control
- Measure of association: odds ratio
- Example: one town followed over years for mortality versus a matched town
- Follows groups forward, so cohort
- Relative risk = 15% ÷ 10% = 1.5 at that time point
- Example: rate of an outcome 230 per 100,000 in exposed and 71 per 100,000 in unexposed
- Relative risk = 230 ÷ 71 ≈ 3.2
Spotting confounding in a design
- Example: children who use bottles had more diarrhea than those who use cups
- Bottle use also tracks with younger age
- Age is linked to both the exposure and the illness
- That makes age a confounder, not proof that bottles caused it
Exam traps
- A study that starts with disease uses odds ratio, not relative risk.
- A new rare cluster of cases compared with non-cases points to case-control.
- A statistical link between exposure and outcome can still be confounded.
✅ Recap
finalMost important facts
- A sample result is only an estimate of the population value.
- SE = SD ÷ √n; bigger samples shrink the SE.
- 95% CI ≈ result ± 1.96 × SE; 99% CI uses 2.58.
- Higher confidence gives a wider, less precise interval.
- A ratio CI containing 1.0 is not significant; a difference CI containing 0 is not significant.
- The null hypothesis says findings are chance.
- We reject or fail to reject the null; we never accept it.
- p ≤ 0.05 means reject the null by the usual rule.
- A p-value is not the probability that the null is true.
- Type I error: false alarm, probability = alpha.
- Type II error: missed effect, probability = beta.
- Power = 1 − β; more sample size raises power.
- Correlation runs −1 to +1 and does not prove cause.
- t-test: 2 means; paired t-test: linked measurements.
- ANOVA: 3 or more means; chi-square: counts in categories.
- Case-control uses odds ratio; cohort uses relative risk.