Where a data file contains two distinct weight variables, such as one weight designed to rectify an imbalance in the sample (e.g., over- and under-representation by age, gender, and geography), and another which represents some aspect of the importance of the respondent (e.g., number of purchases) you can combine weight variables by multiplying them together in a new JavaScript variable.
Requirements
More than one weight variable
Method
- In the Data Sources tree, hover and click + > Custom Code > JavaScript > Numeric.
-
Enter the following code into the Code Editor
panel, where weight1 and weight2 are the names of the two weight variables. If you have additional weight variables to combine, continue to add them using the same format.
//Multiply all weight variables together weight1 * weight2 - Give this new variable a Name and a Label.
- Check Usable as a weight to make this variable available to be used as a weight.
UPCOMING WEBINAR: The Roadmap for Market Researchers in the Age of AI