You can create weights for your project using constructions. Create new weight variables from measures or build the weight with user-entered values.
In this article
1. Creating weights
To create a new weight, you first need to select the desired position in the project tree. From here choose new weight under construct from the design menu Learn more about the design menu. and then define using the expression in the editor.
You can define a weight from an existing measure or using the same conditions and functions used for defining measures.Learn more.
From an existing measure
This is an example, where after loading your data the weighting factors are imported into Harmoni as a measure instead of weights.
Learn more about Harmoni recognizing weights in SPSS files.
To define your weight you need to select the relevant measure in the expression editor.
Using conditions and functions
The values defined in the weight are the factors to apply to each respondent in the target group.
Typically, more than one value needs to be applied when defining a weight, so nested if statements are required.
- The syntax for a nested if statement is:
if (Logic_Test, Value_if_True, if (Logic_Test, Value_if_True, Value_if_False))
Example
Let's assume you want to apply a different weighting factor to respondents in your project based on Gender and Age Group.
- Apply a factor of 0.789 to the young males (under 20 to 34 years)
- Apply a factor of 0.678 to the young females (under 20 to 34 years)
- Apply a factor of 0.567 the middle age males (35 to 54 years)
- Apply a factor of 0.456 to the middle age females (35 to 54 years)
- Apply a factor of 0.345 to the older males (55 or older)
- Apply a factor of 0.234 to the older females (55 or older)
- Weight out anyone else - a factor of 0.
In this case, you need to use and if nested statement:
if (Logic_Test, Value_if_True, if (Logic_Test, Value_if_True, Value_if_False))
Where:
- Logic Test - Gender and Age Group definitions
- Value if true - Factor to be applied
- Value if false - Weight out anyone else
2. Define weights for analysis
There are several ways weights can be used in Harmoni for Analysis. You can have a default weight, an auto weight, or you can manually select a weight for an analysis.
a) Default Weight
Each project can have one weight set as the default weight for the project. This means that whenever you create an analysis, the weight set as the default is applied.
To set a default weight, select the weight and choose set default under weight (wgt) from the design menu.
In a multi-level project, each level may have a different default weight. An analysis table includes the correct weight from each level.
If you manually select a weight when creating an analysis table, the new weight will apply to all levels, overriding the default weights.
Users can override a default weight by dragging a different weight to the weight drop zone. Learn more here.
b) Auto Weight
An auto weight can be applied to a specific variable. This means that whenever that variable is included in an analysis, the auto weight is also applied to the analysis.
To apply a specific weight to a variable, select the relevant weight variable in your project tree and then and choose copy as auto wgt under weight (wgt) from the design menu.
After this select the variable you want the weight to be applied to, and choose to apply auto wgt from weight (wgt) in the design menu.
It is possible to include more than one variable with different auto weights together in either the across or down of the analysis. You cannot, however, have different weights applied to the across and down. If items with auto weights are selected in different dimensions of the analysis, the weight(s) associated with the down variable(s) is applied.
Default Weight
- To set a default weight, select the weight and choose set default.
Autoweight
- To apply a specific weight to a variable, select the relevant weight variable and copy as auto wgt.
- Select the variable you want the weight to be applied to and select apply auto wgt.
Where to from here?
Learn more about different construction types.