# The Weighted Mean and the Median

In the previous lesson discussing the mean, we learned about the mean and worked with a dataset that describes characteristics of houses sold between 2006 and 2010 in Ames, Iowa.

In this lesson, we’ll explore a few edge cases where it’s either impossible to compute the mean, or it’s possible but not theoretically sound. You will also learn about the weighted mean, how to calculate the weighted mean, and another value to summarize the distribution: the median. You’ll learn how to find the median with an even set of values, and how to find the median for ordinal scales. You’ll find out why the median is known as a robust statistic, and why the median is an ideal value to summarize the entire distribution.

While exploring the weighted mean and how the median can be used to summarize a distribution, we’ll be working with a dataset that describes characteristics of houses sold between 2006 and 2010 in Ames.

As you work through each concept, you’ll apply what you’ve learned from within your browser; there’s no need to use your own machine to do the exercises. The Python environment inside of this course includes answer-checking to ensure you’ve fully mastered each concept before moving on to the next.

## Objectives

• Understand what the weighted mean is.
• Learn how and when to use the weighted mean.
• Understand what the median is.
• Learn how and when to use the median.

## Lesson Outline

1. Introduction
2. Using namespace in R
3. Different Weights
4. The Weighted Mean
5. The Median for Open-ended Distributions
6. Distributions with Even Number of Values
7. The Median as a Resistant Statistic
8. The Median for Ordinal Scales
9. Sensitivity to Changes
10. Next steps
11. Takeaways