How to Weight Only a Part of a Data File
Sometimes it is desirable to only weight a part of data file. For example, data may have been collected in two regions, and it may be appropriate to weight only one of those regions.
- Create a filter which represents the respondents to be weighted, calling this filter Sample to be weighted.
- On the Variables and Questions tab, set the Name for the filter to weighted.
- On the Outputs Tab create a SUMMARY table of Sample to be weighted (make sure no weights nor filters are applied).
- Export this table to Excel.
- Start by creating a weight in the normal way.
- Select the first variable to be used as a target as Target question(s).
- If necessary, add additional variables in the second dropdown menu (e.g., if you have separate targets for combinations of age and gender, you would put age in the first dropdown and gender in the second).
- In Excel, compute the desired targets. For example, if 35% of Sample to be weighted are Selected, and your desired targets are are 25% males and 75% females, you compute the target for males as .35*25 and for females as .35*75 (i.e., 8.75 and 29.75).
- Repeat the calculations in the previous step for the Not selected data (i.e., multiplying the desired targets by the Not selected value). If you have done this correctly, the targets will add up to precisely 100. Note that whatever values you enter in this step will not contribute to the final weights, and are only being entered because it is a requirement of Q's weighting algorithm that targets are provided for the total database.
- Set Target column question(s) to Sample to be weighted.
- Fill in the Targets.
- Check that the percentages at the bottom of each column are correct (this should align with the proportion of the sample to be not weighted and weighted).
- Check that the percentages at the end of each row are correct. These should align with the targets you required in the weighted sample.
- If necessary, press Add Weight Set and repeat this process for additional variables.
- Press OK.
- Change the Name of the newly-created variable to totalWeight.
- Give it a Label of Partial Weight and an Expression of if (weighted) totalWeight; else 1 and press OK.
- Press the yellow W for the variable in the Tags column.
- Apply the weight (in the Outputs Tab).