Sometimes you may wish to use a weight for analysis that was not created by Displayr's built-in weighting tool. It's only a matter of checking a box for Displayr to allow a variable to be used as a weight on outputs and analysis. However, there are requirements as to how this variable is structured.
Requirements
- A variable in a data set with a value to use as the weight for each case with a Structure of Numeric.
- The weight variable should be in the same data set used for the analysis (you may need to paste in the values as a new variable in the code editor or merge the weighted values into your data set to do this). However, you can also use a variable in a different data set as long as there is a relationship linking the data sets together.
Method
1. Select the weight variable in Data Sources on the left hand side of the screen.
2. With it selected, go to the object inspector > Data > Properties.
3. Select the Usable as a weight checkbox.
Ticking this box makes the variable available as a weight to be applied to an output.
Apply the weight
A weight variable can be applied to outputs that use raw data/variables as their input (such as built-in drag and drop tables, regressions, custom calculations, etc). To apply a weight:
- Select the item(s) (e.g., tables, page, etc) to be weighted. Note that when selecting items in the Report tree, the weight will be applied to all applicable items within the Page(s)/Folder(s) selected.
- In the object inspector go to Data > Filters & Weight > Weight and select the weight variable.
Next
How to Configure A Weight from Variable(s)
How to Apply a Weight to a Specific Column Only
How to Apply a Weight to a Specific Column Span Only