100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

Hypothesis Testing Cheat Sheet

Hypothesis Testing Cheat Sheet

Core statistical hypothesis testing concepts and workflows, covering t-tests, chi-square tests, p-values, and confidence intervals with scipy.

2 PagesBeginnerMar 8, 2026

T-Tests

One-sample, independent, and paired t-tests.

python
from scipy import statsgroup_a = [23, 25, 21, 22, 24, 20, 26]group_b = [28, 30, 27, 29, 31, 26, 32]# One-sample t-test: is the mean different from a known value?t_stat, p_val = stats.ttest_1samp(group_a, popmean=25)# Independent two-sample t-test (Welch's, unequal variance assumed)t_stat, p_val = stats.ttest_ind(group_a, group_b, equal_var=False)# Paired t-test: same subjects measured twice (before/after)before = [10, 12, 9, 11, 14]after = [12, 13, 10, 13, 15]t_stat, p_val = stats.ttest_rel(before, after)print(f"t = {t_stat:.3f}, p = {p_val:.4f}")

Chi-Square, ANOVA & Non-Parametric Tests

Tests for categorical and non-normal data.

python
from scipy.stats import chi2_contingency, f_oneway, mannwhitneyu# Chi-square test of independence (categorical vs categorical)table = [[50, 30], [20, 40]]  # contingency tablechi2, p, dof, expected = chi2_contingency(table)# One-way ANOVA: compare means across 3+ groupsgroup_c = [22, 24, 23, 25]f_stat, p_val = f_oneway([23, 25, 21, 22], [28, 30, 27, 29], group_c)# Mann-Whitney U: non-parametric alternative to the t-test (no normality assumption)u_stat, p_val = mannwhitneyu([23, 25, 21, 22], [28, 30, 27, 29])

Core Terms

Vocabulary used across hypothesis tests.

  • Null hypothesis (H0)- the default assumption of 'no effect' or 'no difference'
  • Alternative hypothesis (H1)- what you're trying to find evidence for
  • p-value- probability of observing data this extreme (or more) if H0 is true
  • Significance level (α)- threshold for rejecting H0, typically 0.05
  • Type I error- rejecting a true H0 (false positive), rate = α
  • Type II error- failing to reject a false H0 (false negative), rate = β
  • Confidence interval- range of plausible values for a parameter at a given confidence level (e.g. 95%)
  • One-tailed vs two-tailed- whether the test checks for an effect in one direction only or either direction

Choosing the Right Test

Match the test to your data type and design.

  • Compare two group means, normal data- independent samples t-test
  • Compare two group means, before/after- paired t-test
  • Compare 3+ group means- one-way ANOVA (then post-hoc tests like Tukey HSD)
  • Compare two proportions/categorical counts- chi-square test of independence
  • Compare two groups, non-normal/ordinal data- Mann-Whitney U test
  • Test correlation between two continuous variables- Pearson (linear) or Spearman (monotonic) correlation test

Statistical Power & Sample Size

Compute required sample size or achieved power before running a test.

python
from statsmodels.stats.power import TTestIndPowerfrom statsmodels.stats.proportion import proportion_effectsize, samplesize_proportions_2indep_onetailanalysis = TTestIndPower()# Required n per group to detect Cohen's d=0.5 at alpha=0.05, power=0.8n_needed = analysis.solve_power(effect_size=0.5, alpha=0.05, power=0.8, ratio=1.0)print(f"n per group: {n_needed:.0f}")# Achieved power given a fixed sample sizeachieved_power = analysis.solve_power(effect_size=0.5, nobs1=40, alpha=0.05, ratio=1.0)print(f"power: {achieved_power:.3f}")# Sample size for a two-proportion test (e.g. conversion rate A/B)effect = proportion_effectsize(0.10, 0.12)  # baseline 10% -> 12%n_prop = samplesize_proportions_2indep_onetail(effect, prop1=0.10, alpha=0.05, power=0.8)print(f"n per arm: {n_prop:.0f}")

Multiple Comparisons Correction

Control false positives when running many hypothesis tests at once.

python
from statsmodels.stats.multitest import multipletestsp_values = [0.001, 0.02, 0.03, 0.04, 0.049, 0.08, 0.12, 0.30]# Bonferroni: strict, controls family-wise error rate (FWER)reject, p_bonf, _, _ = multipletests(p_values, alpha=0.05, method="bonferroni")# Holm: uniformly more powerful than Bonferroni, still controls FWERreject_holm, p_holm, _, _ = multipletests(p_values, alpha=0.05, method="holm")# Benjamini-Hochberg: controls false discovery rate (FDR), less conservative,# preferred when running many tests (e.g. genomics, feature screening)reject_fdr, p_fdr, _, _ = multipletests(p_values, alpha=0.05, method="fdr_bh")print("BH-adjusted:", p_fdr.round(3))print("Rejected H0:", reject_fdr)

Permutation Test

Distribution-free test that makes no normality assumption.

python
import numpy as npfrom scipy import statsrng = np.random.default_rng(42)group_a = np.array([23, 25, 21, 22, 24, 20, 26])group_b = np.array([28, 30, 27, 29, 31, 26, 32])def statistic(x, y):    return np.mean(x) - np.mean(y)# scipy's built-in permutation test (exact or Monte Carlo)res = stats.permutation_test(    (group_a, group_b), statistic,    n_resamples=10000, alternative="two-sided", random_state=rng)print(f"observed diff = {res.statistic:.3f}, p = {res.pvalue:.4f}")# Manual version: shuffle labels, recompute the statistic, compare to observedpooled = np.concatenate([group_a, group_b])n_a = len(group_a)observed = statistic(group_a, group_b)perm_diffs = np.empty(10000)for i in range(10000):    shuffled = rng.permutation(pooled)    perm_diffs[i] = statistic(shuffled[:n_a], shuffled[n_a:])p_manual = np.mean(np.abs(perm_diffs) >= np.abs(observed))

Bootstrap Confidence Intervals

Estimate a CI for any statistic without assuming a sampling distribution.

python
import numpy as npfrom scipy import statsdata = np.array([23, 25, 21, 22, 24, 20, 26, 27, 19, 24])# scipy.stats.bootstrap: BCa (bias-corrected accelerated) interval by defaultres = stats.bootstrap(    (data,), np.median, confidence_level=0.95,    n_resamples=9999, method="BCa")print(f"95% CI for median: ({res.confidence_interval.low:.2f}, {res.confidence_interval.high:.2f})")# Manual percentile bootstrap for a custom statistic (e.g. trimmed mean)rng = np.random.default_rng(0)boot_stats = np.array([    stats.trim_mean(rng.choice(data, size=len(data), replace=True), 0.1)    for _ in range(9999)])lo, hi = np.percentile(boot_stats, [2.5, 97.5])

Effect Size Reference

Statistical significance ≠ practical significance — always report an effect size alongside p-values.

  • Cohen's d- standardized mean difference; (mean1-mean2)/pooled_std; 0.2=small, 0.5=medium, 0.8=large
  • Hedges' g- bias-corrected variant of Cohen's d, preferred for small samples (n < 20 per group)
  • Eta squared (η²)- proportion of variance explained by group membership in ANOVA; 0.01=small, 0.06=medium, 0.14=large
  • Cramer's V- effect size for chi-square tests of association between categorical variables, range [0, 1]
  • Odds ratio- ratio of odds of an outcome between two groups; used for 2x2 tables and logistic models
  • r (rank-biserial)- effect size companion to Mann-Whitney U, comparable across non-parametric tests
  • Number needed to treat (NNT)- 1/absolute risk reduction; how many subjects must be treated to prevent one additional bad outcome
Pro Tip

A p-value tells you the probability of the data given the null hypothesis, not the probability the null hypothesis is true — don't say 'there's a 95% chance treatment works,' say 'if there were no effect, data this extreme would occur less than 5% of the time.'

Was this cheat sheet helpful?

Explore Topics

#HypothesisTesting#HypothesisTestingCheatSheet#DataScience#Beginner#TTests#Chi#Square#ANOVA#MachineLearning#Testing#CheatSheet#SkillVeris

Frequently Asked Questions

21 categories · pick one to explore

Does SkillVeris have a tech blog, and what does it cover?
Yes, the SkillVeris blog has over 500 articles covering AI and machine learning, programming, web development, DevOps, cloud, security, databases and career guidance. Articles are practical and answer-first, and many use the Learn Through Hobbies approach, teaching technical concepts through cricket, music, gaming or cooking analogies. Everything is free to read.
What is the SkillVeris tech glossary and how big is it?
The SkillVeris glossary is a free reference of roughly 2,000-plus technology terms, each with a clear plain-language definition. It spans AI, programming, web, DevOps, cloud, security and database vocabulary, so whenever a lesson, article or job description uses jargon you do not recognise, the glossary gives you a fast, reliable answer.
Are the developer cheat sheets on SkillVeris free to download?
The cheat sheets are completely free to use, like everything else on SkillVeris. Each sheet condenses a language or tool into its essential syntax, commands and patterns for quick reference while coding. They are designed for rapid lookup during real work, complementing the deeper explanations found in study notes and courses.
Which programming references and cheat sheets are available?
Cheat sheets cover the platform's main domains, including programming languages, AI and ML tooling, web development, DevOps, cloud, security and databases, matching the topics of the 37 live courses. Each sheet lists related reading links and hashtags, so you can jump from a quick reference into fuller study notes or blog articles.
How do I find the meaning of a technical term quickly?
Search the SkillVeris glossary, which holds around 2,000-plus terms with concise, plain-language definitions. Each entry gets to the point in its first sentence, then links to related reading like blog posts or study notes for deeper context. It is faster and more consistent than sifting through scattered search results.
Is the SkillVeris blog good for beginners learning to code?
Yes, many blog articles are written specifically for beginners, and the Learn Through Hobbies style makes them unusually approachable: you might learn Python concepts through cricket or understand APIs through cooking. With 500-plus articles across skill levels, beginners can start with fundamentals and keep reading as they advance, entirely free.
Can cheat sheets replace full courses for learning a language?
No, cheat sheets are references, not teaching tools; they assume you already understand the concepts and just need syntax or commands fast. To actually learn a language, take a structured SkillVeris course with its 24–40 lessons and assessments, then keep the cheat sheet beside you while practising in Code Lab.
How often are new blog articles published on SkillVeris?
The blog grows regularly and already exceeds 500 articles, with new posts added as courses launch and technologies evolve. Topics track the platform's catalogue across AI, programming, web development, DevOps, cloud and security, so checking the Blog section periodically surfaces fresh tutorials, explainers and career-focused pieces, all free to read.
Does the glossary cover AI and machine learning terms?
Yes, AI and machine learning vocabulary is a major part of the roughly 2,000-plus term glossary, covering everything from foundational terms to modern concepts around LLMs, RAG and MLOps. Definitions are plain-language and answer-first, which helps when dense AI papers or course lessons throw unfamiliar jargon at you.
Are there cheat sheets for interview preparation?
Cheat sheets work well as interview-day refreshers because they compress syntax, commands and key concepts into scannable references. For dedicated preparation, combine them with the SkillVeris interview questions feature, which includes readiness scoring, plus study notes for depth. Reviewing a relevant cheat sheet just before an interview steadies recall under pressure.
Can I read the tech blog without signing up?
Yes, the blog is freely readable, and SkillVeris never charges for content. All 500-plus articles are open, covering tutorials, concept explainers and career advice. Creating a free account adds value elsewhere on the platform, like course progress tracking and certificates, but reading the blog requires no commitment at all.
How is the SkillVeris glossary different from Wikipedia?
The glossary is purpose-built for learners: definitions are short, plain-language and answer-first, sized for a quick lookup mid-lesson rather than a deep encyclopedic read. Entries also cross-link to related SkillVeris study notes, blog posts and courses, so a definition becomes a doorway into structured learning instead of a dead end.
Do blog articles use the Learn Through Hobbies method?
Many blog articles teach technical topics through hobby analogies, a hallmark of the SkillVeris blog, so you will find articles explaining programming through cricket, machine learning through music, or system design through cooking. The analogy is the teaching device; the article still delivers the real technical concept underneath.
Where can I find quick programming references while coding?
Open the SkillVeris cheat sheets, which are built exactly for that moment: compact, scannable references for syntax, commands and common patterns across languages and tools. Keep the relevant sheet in a browser tab while you work in Code Lab or your own editor, and dip into the glossary for terminology.
Is there a glossary entry for terms I meet in job descriptions?
Very likely yes, with roughly 2,000-plus terms across AI, programming, web, DevOps, cloud, security and databases, the glossary covers most jargon that appears in tech job descriptions. Decoding a listing this way helps you judge role fit honestly and prepares you to discuss those terms in interviews.
Are the blog articles written for the Indian tech audience?
The blog serves Indian learners plus a worldwide audience. Content stays globally relevant while acknowledging realities that matter in India, such as free access being essential for students and freshers, and career guidance that connects naturally to the SkillVeris jobs portal, which aggregates roles across India, UK, USA, Germany and Remote.
Can I suggest a topic for the blog or glossary?
SkillVeris content grows in response to what learners need, so feedback is welcome through the platform's support channels. If a term is missing from the glossary or a topic deserves an article, telling the team helps prioritise it. Meanwhile, the AI Mentor can answer the question immediately, 24/7, at any depth.
Do cheat sheets and glossary entries link to deeper learning?
Yes, every cheat sheet and glossary entry carries related reading links into study notes, blog articles and courses, plus concept hashtags for discovering similar content. This cross-linking means a thirty-second lookup can smoothly become a structured learning session whenever you decide you want more than a quick answer.
What makes SkillVeris programming references trustworthy?
The references are written to strict internal quality standards, kept consistent with the platform's 37 live courses, and never padded with invented statistics or hype. Definitions and cheat sheets are reviewed against the same content contracts that govern courses, and the answer-first style makes any inaccuracy easy to spot and correct.
How do the blog, glossary and cheat sheets fit into my learning routine?
Use them as satellites around your main course: read blog articles for context and motivation, hit the glossary the instant jargon appears, and keep cheat sheets open while coding. Together with study notes, Code Lab and the 24/7 AI Mentor, they turn passive reading into a complete, free learning system.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse