The simplest way to analyze a survey is to count each respondent equally. One respondent is one respondent. But in practice we often need to be more nuanced and weight some responses or respondents more than others.
Protobi allows you set weights -- for individual elements or globally -- and toggle them on/off.
A survey sample might not exactly match the population in some aspect. For instance, we might in a survey of 1000 consumers and collected a sample that has 600 male and 400 female respondents, but might have other data that tell us the actual market in that category is 50% male and 50% female.
In this case, we might need to differentially weight the responses to match the population:
- Up-weight female respondents by 1.250 (i.e. 400 x 1.250 = 500)
- Down-weight male respondents by 0.8333 (i.e. 600 x 0.8333 = 500)
Or we might sample one population, but project to another. In a survey of physicians about their treatment patterns, some physicians may treat many patients and some fewer. So we might weight respondents by the number of patients the physician treats so that the result are projectible to the patients they treat.
1. Define a weight column or value
To weight data differentially in Protobi, your dataset must have a column in your dataset that has a weight value for each respondent.
If the column is not already in your dataset, you'll need to add it and upload the revised data. If your SPSS SAV file identifies a weight column, Protobi should recognize it as a global weight.
You name the weight field anything, e.g. 'RESP_WT'. In the example above, the column would have the value 1.25 for female respondents, and 0.8333 for male respondents.
Alterntatively, you can define a weight as a scalar, e.g. 1.02 or 100, instead of a field name. This can be useful if you need to weight all respondents equally but by some number other than one. This works with both global and individual weights.
2. Set a global weight
You can define a weight field globally that applies to all elements. Click the ☰ icon in the toolbar to edit project properties, and select "Weight field". Enter the name of the column specifying weights.
3. Set individual weights
In Protobi you can set weights for an individual element. Select the item and click "Edit...". This will bring up an advanced edit dialog with the element properties in JSON syntax. Define a property `"weight"` with the name of the weight field.
The example below is from the car_sales.sav dataset and here we're weighting automobiles by the field sales :Weights on individual elements override any global weights. For instance, to avoid weighting the global weight field by itself, we can specify "weight": null.