Hypothesis Testing
Learn to perform t-tests, chi-square tests, and interpret p-values for data-driven decisions.
Hypothesis Testing is a free R Academy lesson on CoddyKit — lesson 3 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the R Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.
1
Introduction to Hypothesis Testing
Hypothesis testing is a statistical method to determine whether there is enough evidence to reject a null hypothesis.

2
Null and Alternative Hypothesis
In hypothesis testing:
- The null hypothesis (H₀) assumes no effect or difference.
- The alternative hypothesis (H₁) suggests an effect or difference.
3
Performing a t-Test
A t-test checks if two groups have significantly different means.
data1 <- c(5.1, 6.2, 5.8, 6.5, 5.9)
data2 <- c(7.0, 6.8, 7.5, 7.1, 6.9)
t.test(data1, data2)4
Interpreting p-values
The p-value helps decide whether to reject H₀:
- If p-value < 0.05, reject H₀ (significant result).
- If p-value > 0.05, fail to reject H₀ (not significant).
5
Chi-Square Test
The chi-square test checks if categorical variables are independent.
observed <- matrix(c(20, 30, 50, 40), nrow=2)
chisq.test(observed)6
ANOVA Test
ANOVA compares means across multiple groups.
group1 <- c(5.1, 6.2, 5.8)
group2 <- c(7.0, 6.8, 7.5)
group3 <- c(4.9, 5.5, 5.2)
data <- data.frame(value = c(group1, group2, group3),
group = rep(c('A', 'B', 'C'), each=3))
aov_test <- aov(value ~ group, data = data)
summary(aov_test)7
Effect Size
Effect size measures the strength of a result, helping determine practical significance.
8
9
Limitations of Hypothesis Testing
Hypothesis testing relies on assumptions and can be influenced by sample size and data quality.
10
Summary
In this lesson, you learned:
- How to perform hypothesis testing.
- How to use t-tests, chi-square, and ANOVA.
- The importance of p-values and effect sizes.

Frequently asked questions
Is the “Hypothesis Testing” lesson free?
Yes — the full text of “Hypothesis Testing” is free to read here on the web, and the R Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the R Academy course, upgrade to CoddyKit PRO.
What will I learn in “Hypothesis Testing”?
Learn to perform t-tests, chi-square tests, and interpret p-values for data-driven decisions. You practise R Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start R Academy?
No prior experience is required. R Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 3, so you can start here or from the beginning and move at your own pace.
How long does the “Hypothesis Testing” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this R Academy lesson?
Yes. Every R Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Descriptive Statistics
- Probability Distributions
- Hypothesis Testing