This article describes how to create weights from variable(s) in Displayr. Weighting is a technique which adjusts the results of a survey to bring them into line with some known characteristics of the population. For example, if a sample contains 40% males and the population contains 49% males, weighting can be used to correct the data to correct for this discrepancy.
- One or more variables in your data set that you want to use to create weights. These variables can be categorical or numeric.
- The targets for each category in the weight variable. These can be percentages or population counts.
- Variables need to be single-choice. You cannot use multi-choice variables.
Specify a single adjustment variable
- Select Anything > Weight.
- Use the Adjustment Variable(s) box menu to select the categorical or numeric variable(s) you want to weight by. Then specify the Percentages for each category. Note that if your weight targets are percentages, the total must sum to 100. If you would rather use counts instead, use the pull-down menu to the right of Percentages to specify Population/Count:
For example, if your desired targets are 60% Male and 40% Female, you would specify:
Specify additional adjustment variable(s)
If you want to weight by more than one variable, click the Additional adjustment variable set tool and select the variable you want. For example, if you want to not only weight by Gender but also how frequently respondents drink coffee, do the following:
- Add the desired variable, which in this case is Coffee:
Combine categories in a weight variable
You can drag and drop categories for a variable to combine them for weighting within the weight tool. For example, in the Coffee variable, if you wanted to combine 4 of 5 days a week with Every or nearly every day, simply:
- Click the Every or nearly every day category
- Drag and drop it on the 4 to 5 days a week category.
Note: your percentages will revert to 0's when you drag and drop one category on another so you will have to specify them again if you haven't already.
Create two dimensional weights
Use the Adjustment Variable(s) box menu to the right of by to select additional variable(s).
For example, if you wanted to weight your data according to Income by Gender, you would specify:
Recompute weights for each category in another variable (e.g. wave data).
In some cases, it is desirable to calculate a weight based on group membership or time period. For example, in longitudinal studies, when the data is collected in waves, it is necessary to recompute the weight for each date period (week, month, etc.). By default, the weights are computed for the entire data set. This allows you to enter targets in terms of each month's sample, rather than the total sample. You may also select a Pick One question if the targets should be recalculated for each its categories (e.g. for each "wave" of a tracking study).
To recompute weights:
- From the Recompute weights for menu, select the grouping variable. In this example, the variable is called Interview Date
As with all Q's weighting, the weights are recomputed whew data is imported, so this option enables the weighting to automatically compute new weights for new waves. This allows you to enter the targets in terms of each month's sample, rather than the total sample. You may also select a Pick One question if the targets should be recalculated for each its categories (e.g. for each "wave" of a tracking study).
Saving weight variables:
- Once you have an appropriate weight specified, on the bottom-right the button becomes active. Pressing this button takes you back to the main interface and you see the weight variable being added (saved) to the data set tree.
A variable is applied as a weight by:
- Selecting the object (e.g., page) to be weighted.
- Choosing the appropriate weight from Inputs > FILTERS & WEIGHT > Weight.
In order for a variable to be available as a weight, it needs to be set as Usable as a weight in the Properties tab of the Object Inspector.
Troubleshooting 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 a common situation when a 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.
For example, let's say you attempt to create a weight with the following variable. Notice that the first category has zero cases.
When I select Anything > Weight and define the desired percentages, you will see the following error along with a suggestion about how to correct it which in this case is to set the targets for the empty categories to 0.
Version with error:
Version with weight set to 0:
Another solution is to merge the empty categories with other categories. Merging is done by dragging-and-dropping categories in the table where weight targets are entered:
Version with empty categories merged with other categories: