Bird
0
0

Which code snippet correctly performs this test?

hard📝 Application Q8 of 15
SciPy - Statistical Tests
You have two groups of exam scores: group A = [55, 60, 65, 70], group B = [50, 58, 62, 68]. You want to test if group A scores are generally higher than group B using Mann-Whitney U test. Which code snippet correctly performs this test?
Amannwhitneyu(groupA, groupB, alternative='greater')
Bmannwhitneyu(groupB, groupA, alternative='greater')
Cmannwhitneyu(groupA, groupB, alternative='less')
Dmannwhitneyu(groupB, groupA, alternative='less')
Step-by-Step Solution
Solution:
  1. Step 1: Define hypothesis

    We want to test if group A scores are higher than group B.
  2. Step 2: Choose alternative parameter

    Use alternative='greater' to test if first sample tends to be greater than second.
  3. Step 3: Pass samples in correct order

    First argument should be groupA, second groupB.
  4. Final Answer:

    mannwhitneyu(groupA, groupB, alternative='greater') -> Option A
  5. Quick Check:

    Test if A > B = B [OK]
Quick Trick: Use alternative='greater' with first sample as group to test higher values [OK]
Common Mistakes:
MISTAKES
  • Swapping sample order
  • Using wrong alternative parameter
  • Confusing greater with less

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes