QScript WeightDefinition

From Q
Jump to navigation Jump to search

WeightDefinition

Describes a complete weighting calculation: one or more weight sets plus the algorithm and bounds used to compute the final weight. Mirrors the constraints the weighting dialog enforces; an invalid definition is rejected up front by the wrapper's pre-validation pass before any variable is created or changed.

algorithm

The weighting algorithm to use. Defaults to 'Q'. Numeric weight sets are only supported under 'Linear', 'Raking' or 'Logit'; a definition with a numeric weight set under 'Q' is rejected.

designWeightQuestion

The question that supplies the existing design weight. Cannot be a Text or Date/Time question.

maxWeight

The largest weight any respondent may receive. Must be non-negative, and greater than minWeight when both are set.

minWeight

The smallest weight any respondent may receive. Must be non-negative, and less than maxWeight when both are set.

recomputeQuestion

The question to recompute when the weight is applied.

weightSets

The weight sets that make up this weighting. Each set targets a crosstab of questions against a set of category targets. At least one set is required.

weightSumMode

Whether the weights sum to the sample size or to the target values. A definition made up entirely of numeric weight sets must use 'sampleSize'.