# How To Troubleshoot Errors in Weights

When creating a weight it is possible for there to be a mis-match between the targets that have been specified and the actual sample sizes in the data set which prevents the weight from being calculated. This page describes the kinds of mis-match that can occur and the steps that can be taken to allow the weight to be calculated.

Problems with weights often occur when the samples in the categories used by the weight are small or empty. Errors that are encountered when constructing a weight can indicate that there are problems with the sample, or that the weight scheme is too complicated. The general approach to solving problems with weighting is to simplify the weighting scheme by either reducing the number of questions that are being used, or by consolidating categories within the input questions.

When creating a weight you can obtain information about the weight by clicking on the Diagnostics Report button at the bottom left of the weight window.

## Empty Categories

If a category or combination of categories is empty in the data file, then it is logically impossible for that category to represent more than 0% of the data when weighted. As a result, if you assign a target value to that category which is not zero then the weight cannot be calculated.

In this situation, you will see a message like:

This message tells us that there are two categories in the data which are empty, Males, Less than 18 and Females, Less than 18, but that these categories have targets assigned to them. Approaches to solving this problem include:

1. Enter target values of 0 for the empty categories. This will require the other targets to be adjusted appropriately according to the design of the research.
2. Merge the empty categories with other categories. Merging is done by dragging-and-dropping categories in the table where weight targets are entered.

### Example

The warning above was generated for the set of targets for Age and Gender shown on the left. An alternative set of targets (on the right), has been obtained by setting the two empty categories to have targets of 0, and adjusting the remaining targets so that they sum to 100%:

## Rim Weighting does not Converge

When the weighting involves multiple sets of targets (called Weight Sets) Q uses an algorithm called Rim Weighting to estimate the weight for each respondent so that each of the different sets of targets is achieved. Because each set of targets is independent of the others, the situation can arise where one set of weight targets contradicts one of the other sets of targets by predicting two different sample sizes for the same group of respondents. When a contradiction like this occurs then it is logically impossible to calculate an appropriate weight.

In cases of this kind you will see the following message:

### Diagnosing and Solving the Problem

If you have used more than two weight sets then the first step to solving the problem is to identify which pair of questions is in conflict. It is possible that three or more questions can be in conflict with one another. The following process will allow you to identify which weight sets are contributing to the conflict:

1. Use Insert Variables > Weight to create your weight, include as many weight sets in the weight as possible without getting an error in Diagnostics Report.
2. Save the variable by clicking OK in the Weight Construction dialogue box.
3. For each weight set:
1. Right-click the weight variable and select Edit Weight.
2. Complete the weight, ensuring that all targets are entered for all weight sets.
3. Remove the current weight set.
4. Click Diagnostics Report. If an error is still generated then you know that the weight set that you removed is not the source of the conflict in the weight. If an error is not generated then the weight set that has been removed is contributing to the conflict.

The final step is to try and identify the reason why the questions that have been identified above are in conflict with the weight targets. There is no general solution, and the problem can be tricky to identify. Some trial-and-error is required. One approach is to:

1. Create a cross-tab between each pair of questions identified above, and show the n in the Statistics - Cells.
2. Examine the sample sizes in the tables and try to identify those which are particularly small (e.g. n = 1 or n = 2) as these are most likely to present problems.