Weight - Configure Weight from Variable(s)
Jump to navigation
Jump to search
This is the R-based approach to computing weights, that can be applied to tables and other analyses to adjust over- and under-representation of groups in the sample relative to the population. It is recommended to read How to Weight Survey Data for more information. The min/max/iterations fields in the OPTIONS section are using alongside the "repeated raking and trimming" method of trimming weights.
Applying weights using this method involves three steps:
- Configuring the weight (an R Output, accessed via Insert > More > Weighting > Configure Weight from Variable(s)). Key Options for this are discussed below.
- Generating the weighting variable (R Variable, created by selecting the output at (1) above and then going to Anything > Weighting > Multiple Variables > Save Weight Variable from Configuration)
- Applying the variable made at (2) above, to whatever outputs (using the Object Inspector of the relevant target outputs: pages, tables, charts, visualizations)
Example
Options
- Filter(s) If a filter is selected, the weight that is created will only apply to the filtered cases. Other cases will have missing values (NA).
- Weight An (optional) existing weight. If supplied, the new weight will be as close as possible[1] to this existing weight.
CATEGORICAL ADJUSTMENT VARIABLES
- Adjustment variables Categorical, Date/Time, or text variables that are to be used in creating weights. See How to Weight Survey Data for more information.
- Add variable targets One such button will appear for each adjustment variable. When clicked, the targets are added into a spreadsheet (by typing or pasting). They are entered in the following format.
NUMERIC ADJUSTMENT VARIABLES
- Adjustment variables Numeric variables that are to be used in creating weights. See How to Weight Survey Data for more information.
- Add variable targets One such button will appear for each adjustment variable. When clicked, the targets are added into a spreadsheet (by typing or pasting).
OPTIONS
- Minimum Weight The lowest value that a weight will, ideally, have for any case in the data. It is not guaranteed that a weight will be greater than this value, as after application of this minimum, the weight is than divided by its average, so that it takes an average value of 1.
- Maximum Weight The maximum value that a weight will, ideally, have for any case in the data. It is not guaranteed that a weight will be less than this value, as after application of this maximum, the weight is than divided by its average, so that it takes an average value of 1.
- Iterations The number of iterations of the algorithm applied after trimming the weight to reflect the minimum and maximum.
SAVE VARIABLE(S)
Save Weight Variable from Configuration Saves a new variable to the data set that contains the weights.
Code
▶ Show Code
▶ Show Code
See Also
- ↑ Deville, J.-C. and Särndal, C.-E. (1992). Calibration estimators in survey sampling. Journal of the American Statistical Association, 87, 376-382