Visualizing productivity within blocks by incentive
Continuing with the worker productivity example, you'll explore if the productivity scores are distributed throughout the data as one would expect with random assignment of treatment. Note that this is a precautionary step, and the treatment and follow-up results on the impact of the three treatments is not done yet!
seaborn
and matplotlib.pyplot
as sns
and plt
respectively are loaded.
This exercise is part of the course
Experimental Design in Python
Exercise instructions
- Visualize the productivity scores within blocks by treatment using a boxplot with
'block'
forx
,'productivity_score'
fory
, and'Treatment'
forhue
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Make a plot showing how positivity_score varies within blocks
sns.____(x='____',
y='____',
hue='____',
data=prod_df)
plt.show()