Exercise

Paired t-test

Think back to the potato field example that we dealt with previously. Here, you've been provided with a small DataFrame (podataframe) containing information on 10 Fields. We are interested in potato yield in tons/hectare. For each Field, we have a value for its Yield2018, before the application of a new fertilizer, and its Yield2019, after the application of the new fertilizer. You'll need to perform two t-tests, a standard two-sample test, and a paired t-test. A paired t-test will control for the variation between fields. Do the two tests give the same result? scipy.stats is loaded as stats.

Instructions 1/2

undefined XP
  • 1

    Do a standard two-sample t-test, comparing 2018 and 2019 potato yield, save the result to ttestind and print it.

  • 2

    Perform a paired t-test, comparing potato yield from 2018 and 2019, saving the result to ttestpair and printing it.