This guide helps you choose the right statistical test, set up hypotheses, and interpret results. Whether you're comparing means, proportions, or checking associations, this cheat sheet has you covered!
- Identify your data: Are you working with means, proportions, or categories?
- Check assumptions: Ensure your data meets the testβs requirements (e.g., normality, sample size).
- Pick a test: Use the table to find the test that matches your needs.
- Interpret results: Use the decision rules to decide if your results are significant.
Term | Meaning |
---|---|
β Use / β Donβt use | When a test is appropriate or inappropriate. |
Hβ (Null Hypothesis) | The default assumption (e.g., "no difference" or "no effect"). |
Hβ (Alternative Hypothesis) | What you're testing for (e.g., "there is a difference"). |
p-value | Probability of observing your data if Hβ is true. Smaller p-values suggest stronger evidence against Hβ. |
Ξ± (Significance Level) | Threshold for significance (usually 0.05). If p < Ξ±, reject Hβ. |
Critical Value (CV) | Cutoff for test statistic to reject Hβ (depends on Ξ± and test). |
One-sided Test | Tests for a difference in one direction (e.g., "greater than"). |
Two-sided Test | Tests for any difference (e.g., "not equal"). |
df | Degrees of freedom, used to find critical values. |
SD | Standard deviation, measures data spread. |
CV (Critical Value) | Cutoff value from the test distribution for given |
pop. | Population |
gof | Goodness-of-Fit |
Symbol | Meaning |
---|---|
|
Population mean / hypothesized population mean |
Sample mean | |
|
Sample standard deviation / standard deviation of paired differences |
|
Sample size / size of group |
|
Population standard deviation (known for Z-tests) |
|
Sample proportion |
Hypothesized population proportion | |
Significance level (e.g., |
|
|
Individual paired observations |
Pearson correlation coefficient | |
F-statistic: ratio of variances in ANOVA | |
|
Sum of Squares / Mean Square (for ANOVA calculations) |
Chi-square statistic | |
|
Observed / Expected frequencies in contingency tables |
Sum of ranks in group |
|
Mann-Whitney U statistic | |
Kruskal-Wallis H statistic | |
Mean of the paired differences |
Note on Critical Values and Degrees of Freedom:
- df varies by test; see formulas in the main table.
- Use
$\alpha/2 = 0.025$ for two-sided tests.
Two-sided Tests: Detect any difference; alternative
$\neq$ .One-sided Tests: Detect directional change; alternative ">" or "<".
pβvalue vs
$\alpha$ :
- If p <
$\alpha$ : reject$H_0$ βsignificant.- If p β₯
$\alpha$ : fail to reject$H_0$ βinsufficient evidence.Test statistic vs CV:
- Two-sided:
$|\text{stat}| > \text{CV}$ .- One-sided: stat > CV (right) or stat < βCV (left).
- For parametric tests (e.g., t-tests, Z-tests), compare the test statistic to a critical value (e.g.,
$t_{\alpha/2, df}$ ,$Z_{\alpha/2}$ ) or use the p-value against$\alpha$ . - For non-parametric tests (e.g., Chi-square, Mann-Whitney U), decision rules use critical values from respective distributions or p-values.
-
The p-value approach is consistent: reject
$H_0$ if p <$\alpha$ ; otherwise, fail to reject$H_0$ . - Critical Values: If the test statistic exceeds the critical value (or falls in the rejection region), reject Hβ. Critical values depend on Ξ±, df, and the test distribution.
Each test includes when to use it, the formula, key variables, example, hypotheses, tail options, and how to decide whether to reject Hβ.
Test Name | Type | When to Use / Not Use | Formula | Variables | df Formula | Example | Hypotheses | Tail Options | Decision Rule |
---|---|---|---|---|---|---|---|---|---|
One-sample t-test | Parametric | β
mean vs known pop. mean β non-normal small |
30 students: mean=75, s=10 vs 70 |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
|||
Two-sample t-test | Parametric | β
two independent means β non-normal or unequal variances |
BP: A (n=25, mean=120) vs B (n=30, mean=125) |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
|||
Paired t-test | Parametric | β
before/after same group β independent groups |
20 patients: mean change=β5 kg, SD=2 |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
|||
One-sample Z-test | Parametric | β
large β small |
β (known pop) | Widget weight (n=100, mean=50.2, Ο=0.5) vs 50 |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
||
Two-sample Z-test | Parametric | β
large β unknown pop. SD |
β (known pop) | Yield: A (150,200,Ο=15) vs B (180,190,Ο=20) |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
||
Z-test prop. (1) | Parametric | β
prop. vs known β very small |
β (approx.) | 65/100 click vs 60% |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
||
Z-test prop. (2) | Parametric | β
compare two proportions β small |
|
β (approx.) | A:40/200=20% vs B:30/180β16.7% |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
|
Chi-square (gof) | Non-Parametric | β
observed vs expected counts β expected < 5 |
Die rolls vs expected |
|
Two-sided only | Reject |
|||
Chi-square (independ.) | Non-Parametric | β
association between categories β sparse tables |
Gender vs Yes/No |
|
Two-sided only | Reject |
|||
Pearson correlation | Parametric | β
linear relβn β non-linear or outliers |
Height vs weight in 50 people |
|
Two-/One-sided | Two-sided: Reject One-sided: Reject if |
|||
ANOVA | Parametric | β
compare 3+ means β non-normal or unequal variances |
between: within: |
Classes A/B/C scores |
|
Two-sided only | Reject |
||
Mann-Whitney U test | Non-Parametric | β
two independent groups, non-normal β parametric conditions |
not applicable | Stress Day vs Night |
|
Two-/One-sided | Reject |
||
Wilcoxon signed-rank test | Non-Parametric | β
paired non-normal β parametric conditions |
Mood 1β10 before/after therapy |
|
Two-/One-sided | Reject |
|||
Kruskal-Wallis test | Non-Parametric | β
3+ groups non-normal β ANOVA conditions |
Satisfaction N/S/E |
|
Two-sided only | Reject |
Path | Type | Description |
---|---|---|
/license.txt |
File | Project license (GPL-3.0). |
/data/ |
Directory | (Optional) Directory for storing sample or external datasets. |
/notebooks/ |
Directory | Core statistical method notebooks. Each file contains examples, code, and visualizations. |
βββ 01_correlation_analysis.ipynb |
Notebook | Pearson, Spearman, and Kendall correlation methods. |
βββ 02_binomial_distribution.ipynb |
Notebook | Binomial distribution: PMF/CDF, plots, and real-world scenarios. |
βββ 03_poisson_distribution.ipynb |
Notebook | Poisson distribution: modeling count data and visualizations. |
βββ 04_qq_plot.ipynb |
Notebook | Q-Q plots comparing distributions for normality checks. |
βββ 05_t_tests.ipynb |
Notebook | One-sample, two-sample (independent), and paired t-tests. |
βββ 06_z_tests_and_z_score.ipynb |
Notebook | Z-score standardization and z-tests for known population parameters. |
βββ 07_chi_square_tests.ipynb |
Notebook | Chi-square goodness-of-fit and independence tests for categorical variables. |
βββ 08_anova.ipynb |
Notebook | One-way ANOVA for comparing group means across multiple categories. |
βββ 09_mann_whitney_u_test.ipynb |
Notebook | Non-parametric test for comparing two independent samples. |
βββ 10_wilcoxon_signed_rank.ipynb |
Notebook | Non-parametric test for comparing two related samples. |
βββ 11_kruskal_wallis.ipynb |
Notebook | Non-parametric test for comparing more than two independent groups. |
βββ README.md |
File | Overview and usage instructions for the /notebooks directory. |
/demo/ |
Directory | Interactive demos using ipywidgets or Plotly . |
βββ Demo.ipynb |
Notebook | Interactive Pearson correlation picker with live scatterplots. |
βββ README.md |
File | Instructions for running and enabling interactive visualizations. |
/external/ |
Directory | External submodules or dependencies. |
βββ data-science-toolkit/ |
Git Submodule | Data Science Toolkit by pmaji. Used for helper utilities. |
βββ README.md |
File | Attribution and setup instructions for the external toolkit. |
-
README.md: Navigation index, summary of topics, instructions.
-
notebooks/: One notebook per statistical method, with descriptive filenames.
The README.md provides a project overview and directs users to each notebook. It includes:
-
Introduction: Purpose of the toolbox and how to use it.
-
Table of Contents: Links to each notebook (with short descriptions).
-
Usage: Instructions on prerequisites (e.g., Python libraries) and how to run the notebooks.
-
License and Contributing: If open-sourced, license info and contribution guidelines.
-
Correlation Analysis β Exploring Pearsonβs correlation, scatter plots, and interpretation scribbr.com.
-
Binomial Distribution β Modeling number of successes in Bernoulli trials en.wikipedia.org geeksforgeeks.org.
-
Poisson Distribution β Modeling count of events over fixed intervals en.wikipedia.org.
-
QβQ Plot β Visual comparison of distribution shapes en.wikipedia.org.
-
t-Tests (One-sample, Two-sample, Paired) β Testing differences in means under normality assumptions jmp.com statistics.laerd.com jmp.com.
-
Z-Tests and Z-Score β Hypothesis testing with known variance (large n) and standard score formula investopedia.com investopedia.com.
-
Chi-square Tests β Goodness-of-fit and independence tests for categorical data scribbr.com scribbr.com.
-
ANOVA (Analysis of Variance) β Comparing means across >2 groups investopedia.com scribbr.com.
-
MannβWhitney U Test β Nonparametric test for two independent samples en.wikipedia.org.
-
Wilcoxon Signed-Rank Test β Nonparametric paired-sample test (alternative to paired t-test investopedia.com ).
-
KruskalβWallis Test β Nonparametric equivalent of one-way ANOVA library.virginia.edu.