# HHINCOME Avg & Median

How do I weight HHINCOME if I want average HHINCOME or Median by METAREA? Do I multiply by ASECWTH and divide the product by ASECWTH?

There are a few things you’ll need to take into account.

1. Since HHINCOME is at the household level, you should keep only one observation per household. The simplest way to do this is to keep only the records with PERNUM=1.

2. Any statistical software package will allow you to integrate the weights without multiplying them by anything. For example in Stata you would replace

`mean hhincome if pernum==1, over(metarea)`

with

`mean hhincome if pernum==1 [pw=asecwth], over(metarea)`

You might want to check out the IPUMS data training exercises for examples of weighting using various statistical software packages.

1. If you’re manually doing this (for example in Excel), then for the calculation of mean, you would multiply each value of HHINCOME by ASECWTH, sum all of these, then divide the total by the sum of ASECWTH.

2. Weighted medians are a bit more complicated. I’ll refer you to Wikipedia for the definition. These can also be handled by most statistical software packages, but doing the calculation in Excel would be more involved.