1. Learn
  2. /
  3. Courses
  4. /
  5. Experimental Design in Python

Connected

Exercise

Stratifying an experiment

You are working with a government organization that wants to undertake an experiment around how some particular government policies impact the net wealth of individuals in a number of areas.

They have approached you to help set up the experimental design. They have warned you that there is likely to be a small group of users who already have high net wealth and are concerned that this group might overshadow any experimental outcome observed. You know just what to do!

Use your knowledge of experimental design to undertake block randomization, stratifying by the high_wealth column in the provided wealth_data DataFrame. There are 2000 rows in the DataFrame with 200 high net wealth subjects (high_wealth is 1).

Instructions 1/3

undefined XP
    1
    2
    3
  • Create the first block which contains all the high_wealth subjects and set the Block column to 1.
  • Create two groups from this block randomly assigning the high_wealth subjects to the Treatment (T) or control (C) group.