Data Science with Python Certification Statistical Analysis and Hypothesis Testing 2 — Questions and Answers
Question 1: What is a Type I error in hypothesis testing?
- Failing to reject a false null hypothesis
- Rejecting a true null hypothesis (Correct answer)
- Accepting a false alternative hypothesis
- Failing to reject a true null hypothesis
Correct answer: Rejecting a true null hypothesis
A Type I error (false positive) occurs when the test incorrectly rejects a true null hypothesis.
Question 2: Which statistical test should you use to compare means across more than two groups?
- t-test
- z-test
- ANOVA (Correct answer)
- Chi-square test
Correct answer: ANOVA
ANOVA (Analysis of Variance) tests for differences in means across three or more independent groups.
Question 3: What does `scipy.stats.mannwhitneyu()` test in Python?
- Whether two samples have equal variances
- Whether two independent samples come from the same distribution (Correct answer)
- Whether a sample is normally distributed
- Whether a variable is categorical
Correct answer: Whether two independent samples come from the same distribution
The Mann-Whitney U test is a non-parametric test that determines if two independent samples share the same distribution.
Question 4: What is a confidence interval in statistics?
- The probability that a sample mean equals the population mean
- A range likely to contain the true population parameter (Correct answer)
- The standard deviation of the sampling distribution
- The minimum sample size required for significance
Correct answer: A range likely to contain the true population parameter
A confidence interval provides a range of values within which the true population parameter is likely to fall with a specified probability.
Question 5: Which Python function calculates the standard error of the mean?
- scipy.stats.sem() (Correct answer)
- numpy.std()
- pandas.mean()
- scipy.stats.ttest_1samp()
Correct answer: scipy.stats.sem()
`scipy.stats.sem()` calculates the standard error of the mean for a given sample array.
Question 6: What does a Bonferroni correction adjust for when performing multiple hypothesis tests?
- Sample size bias
- Increased Type I error rate (Correct answer)
- Variance inflation
- Skewness in data
Correct answer: Increased Type I error rate
Bonferroni correction divides the significance threshold by the number of tests to control the family-wise Type I error rate.
What is a Type I error in hypothesis testing?