Challenge - 5 Problems
Hypothesis Testing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Understanding p-value interpretation in hypothesis testing
What is the output of this R code that performs a t-test on two small samples?
R Programming
group1 <- c(5, 7, 8, 6, 9) group2 <- c(10, 12, 11, 13, 14) test <- t.test(group1, group2) print(test$p.value < 0.05)
Attempts:
2 left
💡 Hint
Check if the p-value is less than 0.05 to decide significance.
✗ Incorrect
The t-test compares the means of two groups. Since group2 values are higher, the p-value is small, so the test returns TRUE for significance.
🧠 Conceptual
intermediate1:30remaining
Why do we reject the null hypothesis when p-value is low?
Which statement best explains why a low p-value leads to rejecting the null hypothesis?
Attempts:
2 left
💡 Hint
Think about what the p-value measures about the data under the null hypothesis.
✗ Incorrect
The p-value measures how likely the observed data is if the null hypothesis is true. A low p-value means this is unlikely, so we reject the null.
🔧 Debug
advanced2:00remaining
Identify the error in this hypothesis test code
What error does this R code produce when running a t-test?
R Programming
x <- c(1, 2, 3, 4, 5) y <- c(2, 3, 4, 5) t.test(x, y)
Attempts:
2 left
💡 Hint
Check if t.test requires equal length samples.
✗ Incorrect
The t.test function in R can handle samples of different lengths. It runs without error and returns a p-value.
❓ Predict Output
advanced2:00remaining
Output of a one-sided hypothesis test in R
What is the output of this R code testing if mean of x is greater than 5?
R Programming
x <- c(6, 7, 8, 9, 10) test <- t.test(x, mu=5, alternative='greater') print(test$p.value < 0.05)
Attempts:
2 left
💡 Hint
Check if the sample mean is significantly greater than 5.
✗ Incorrect
The sample mean is above 5, so the one-sided test returns a low p-value, making the output TRUE.
🧠 Conceptual
expert2:30remaining
Why do statistical tests rely on probability distributions?
Which option best explains why statistical tests use probability distributions to validate hypotheses?
Attempts:
2 left
💡 Hint
Think about how we decide if data is unusual under the null hypothesis.
✗ Incorrect
Statistical tests use probability distributions to understand what data looks like if the null hypothesis is true. This helps calculate p-values to decide if data is unusual enough to reject the null.