In the previous lesson, you learned about the formula of the z-score, and looked at a few toy examples to explain an observation's standard score for normally distributed data. In this lab, you'll practice by standardizing and visualize some normal distributions.
You will be able to:
- Calculate and interpret z-scores for observations
- Visualize the data before and after standardization to visually inspect the results
A z-score can help identify how many standard deviations above or below the mean a certain observation is. Every time you obtain a z-score, use “above” or “below” in your phrasing.
The yields of apples trees in an orchard has been recorded in the file yield.csv
. Each observation is recorded by weighing apples from trees (in pounds) and adding their weights. There are 5000 observations in total for this data.
Use pandas for loading and inspecting the data.
# Import libraries
# Read the yield data as a dataframe
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
0 | |
---|---|
0 | 39.741234 |
1 | 39.872055 |
2 | 44.331164 |
3 | 46.600623 |
4 | 40.694984 |
# Create a plot
# Your comments about the data here
# Your answer here
# Perform any calculations necessary here
# Write your answer here
# Calculate z
# Interpret the result
# Interpret the z score
# Calculate yield
# What is the yield ?
The units are still the apple trees. For the data set of all z-scores:
- What is the shape?
- The mean?
- The standard deviation?
# Give your solution here
Mean: 0.0
SD: 1.0
# Your observations
In this lab, you practiced your knowledge on the standard normal distribution!