Help the Stat Consulting Group by giving a gift

**Types of weights**

There are several types of weights that you might find or create in a data set.

- probability weights - Perhaps the most common type of weights are probability weights. These weights represent the probability that a case (or subject) was selected into the sample from a population. These weights are calculated by taking the inverse of the sampling fraction. For example, if you have a population of 10 widgets and you select 3 into your sample, your sampling fraction would be 3/10 and your pweight would be 10/3 = 3.33. You frequently find this type of weight in survey data.
- frequency weights - Frequency weights are whole (i.e., integer) numbers that tell the program how many cases each case represents. It is a kind of short cut: if you have five rows of data that are identical, you can use a frequency weight with a value of 5 and spare yourself having to input the same row five times.
- importance weights - Importance weights are just what you think they should be - they are weights that indicate how "important" a case is. There is no standard way of calculating this type of weight.
- analytic weights - Analytic weights are perhaps the least common type of weight. This type of weight is used when the cases are actually an average. If the averages are based on different numbers of observations (for example, some averages are based on three observations and others are based on 30 observations), some cases (averages) are measured with more precision than others, and you want the more precisely measured cases to have a greater weight than the less precisely measured cases. The more measurements used in the average, the more precise the average will be. The weights are proportional to the inverse of the variance.

**In SAS**

You need to read the documentation for the proc that you are using to
determine what kind of weight will be used with the **weight** statement.
The **weight** statement used in one proc might assume frequency weights
while another assumes probability weights. Some procs will handle the
weights differently depending on the values of the **weight** variable.
For example, if all of the values of the **weight** variable are integers
(whole numbers), SAS will assume that you have a frequency weight. If you
specify a different **weight** variable that has decimals, then the proc will
assume that you have a probability weight. If you cannot tell from
the documentation which type of weight will be used, you will either need to do
some experimenting or contact SAS technical support.

**In SPSS**

SPSS Base and SPSS Advanced Models only recognizes frequency weights.
(These are the products for which UCLA has a license, other
modules, which you can purchase at extra cost, such as Complex Samples and
Trees, allow for different types of weights.) If you weight your data with a
different type of weight, SPSS will not issue an error message; however, you
should be sure that you really want your weights to be treated as frequency
weights. Note that if you specify probability weights with a **
weight by** command, some procedures SPSS will round the values of the weights to the nearest
whole number and use them as frequency weights. In some cases, the nearest
whole number may be zero, in which case you may get a message in your output
about this. One exception to this is in the **crosstabs** procedure. If you
click on the "Cells" button or use the **count** subcommand, you can choose between
having the values of the weights rounded or truncated. You can learn more about weights in SPSS by seeing the SPSS
Command Syntax
Reference and look up the section on WEIGHT.

**In Stata**

Stata recognizes all four type of weights. You can specify which type
of weight you have by using the weight option after a command. Note that not
all commands recognize all types of weights. If you use the **svyset**
command, the weight that you specify must be a probability weight. You can find out more
about using weights in Stata by seeing
help weight.

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.