Session Ready
Exercise

Wilcoxon signed-rank test

Here, you've been provided with a small DataFrame (podataframe) containing information on 15 Fields. We are interested in potato yield in tons/hectare, as seen in previous lessons. For each Field, we have a value for Yield2018, before the application of a new fertilizer, and Yield2019, after the application of the new fertilizer. However, the variation between fields is very large and the difference between the years seems small, as seen below.

Boxxplots of potato production from two different years

A paired t-test has been performed and its result is stored as ttestpair. A Shapiro-Wilks test has been performed on each Year's yield, shap2018 and shap2019. Does the yield differ significantly between years? scipy.stats is loaded into the workspace as stats.

Instructions
100 XP
  • Print the paired t-test result.
  • Print the result of the two Shapiro-Wilk tests.
  • Perform a Wilcoxon signed-rank test to compare Yield2018 and Yield2019.