Advanced tables and statistics > Weighting > Using weights in the record alone
 
Using weights in the record alone
Sometimes, you will deal with data in which all weighting information is already in the record or where the weights are all calculated in the edit. The only way to weight using information from the data or edit is to use preweights, because otherwise Quantum expects to read the weights from the wm statement. However, preweights cannot be used by themselves, so you have to set up a dummy weighting matrix as shown here. Using a weighting matrix, write:
a;op=12;dsp;wm=1
wm1 axdum;pre=wtvar;factor;1
          .....
l axdum
n01
If you are declaring weighting in the axes themselves, write:
a;op=12;dsp;wm=1
wm1=axdum
           .....
l axdum;pre=wtvar
n01;wtfactor=1
The weight is read from the given variable (in this case wtvar) and treated as a preweight. Since preweights must be used with targets, factors or proportions, you define a factor of 1, which does not change the value of the preweight when the two are multiplied.
In the weight matrix version, the dummy axis, axdum, contains a single n01 statement with no conditions to correspond to the single factor in the matrix.
If the value in wtvar is 5, the final weight for the respondent is 5 (5x1=5).
See also
Weighting