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. Create Weights
To create a new weight, the Project Owner selects the desired position in the project tree and chooses new weight from the design menu. Learn more about the design menu The expression editor opens and you can enter the definition for the weight.
You can define a weight from an existing measure or by using the same conditions and functions used for defining measures.Learn more about Measures.
a. Create a Weight from an Existing Measure
After loading your data, the weighting factors are imported into Harmoni as a measure instead of weights. In this example, we will use the measure to create the weight.
Learn more about Harmoni recognizing weights in SPSS files.
To define the weight you need to include the relevant measure in the expression editor:
- Select the position in the project tree
- Click new weight and the expression editor opens
- Type in the measure name or drag it from the project tree
- Click Apply Expression
b. Create a Weight using Conditions and Functions
You can also create a weight by building the definition in the expression editor. 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 required for nested IF statements 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 a nested IF statement like this:
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
Learn more about IF statements.
2. Weights for Analysis
There are several ways weights can be applied in an analysis.
- The Project Owner can set a default weight in the project so that the weight is automatically applied
- A user can manually select any weight available in the project and apply it to an analysis
- The Project Owner can include auto weights for specific variables where a different weight is required
a. Set a Default Weight
Each project can have one weight set as the default weight for the project. This means that whenever a user creates an analysis, the weight set as the default is applied.
To set a default weight in the project:
- Select the weight
- Click set default from the weight (wgt) section in the design menu
- To set a default weight, select the weight and choose set default
- The weight item displays a blue dot
Override the Default Weight
Users can override a default weight by dragging a different weight to the weight drop zone.
Learn more about overriding the default weight.
Multi-Level Projects
In a multi-level project, each level may have a different default weight to ensure an analysis table includes the correct weight from each level.
If you manually select a weight when creating an analysis table, the new weight applies to all levels, overriding the default weights.
Learn more about weights in multi-level projects.
b. Set an Auto Weight
A Project Owner can apply an auto weight 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 the project tree
- Click copy as auto wgt from the design menu
- Select the variable you want the weight to be applied to
- Click apply auto wgt from the design menu
- 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
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.
Learn more about using auto weights in an analysis.
Where to from here?
Learn more about different construction types: