Bird
0
0

What is the p-value output of this code?

medium📝 Predict Output Q5 of 15
SciPy - Statistical Tests

What is the p-value output of this code?

from scipy.stats import wilcoxon
x = [5, 7, 9, 11, 13]
y = [6, 8, 10, 12, 14]
stat, p = wilcoxon(x, y, alternative='less')
print(round(p, 4))
A0.5000
B0.9688
C0.0312
D0.2500
Step-by-Step Solution
Solution:
  1. Step 1: Understand alternative='less'

    This tests if median of x is less than y.
  2. Step 2: Calculate Wilcoxon test and p-value

    Since x values are smaller, p-value is low, about 0.0312.
  3. Final Answer:

    0.0312 -> Option C
  4. Quick Check:

    Wilcoxon p-value for less alternative = 0.0312 [OK]
Quick Trick: Use alternative='less' to test if x < y median [OK]
Common Mistakes:
MISTAKES
  • Ignoring alternative parameter effect
  • Misreading p-value direction
  • Rounding p-value incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes