Wilcoxon Signed-Rank Test with SciPy
📖 Scenario: You are a data analyst working with a health study team. They collected blood pressure readings from 6 patients before and after a new treatment. You need to check if the treatment caused a significant change in blood pressure.
🎯 Goal: Build a Python program that uses the Wilcoxon signed-rank test to compare paired blood pressure readings before and after treatment.
📋 What You'll Learn
Create two lists called
before and after with exact blood pressure values.Create a variable called
alpha and set it to 0.05 for significance level.Use
scipy.stats.wilcoxon to perform the Wilcoxon signed-rank test on before and after.Print the test statistic and p-value with clear labels.
💡 Why This Matters
🌍 Real World
The Wilcoxon signed-rank test is used in medical studies, psychology, and other fields to compare paired samples when data may not be normally distributed.
💼 Career
Data analysts and scientists use this test to validate if treatments or interventions cause significant changes in paired observations.
Progress0 / 4 steps