Advanced tables and statistics > Weighting > Defining weights in a weighting matrix > Defining weighting matrices in hierarchical data > anlev=
 
anlev=
In hierarchical data, you can use the anlev= option on the wm statement to cause weights to be applied only at a named level. For example, the statement:
wm2 age hhld;anlev=person; .....
calculates weights at the person level rather than at household level.
It is necessary to weight a table using a weight matrix at the appropriate level, so you generally need to create a weight matrix for each level of data that is present. For example, in a survey that has three levels, hhold, person and trip:
wm1 waccom1;input;anlev=hhold;70;30
wm2 waccom2;input;anlev=person;70;30
wm3 waccom3;input;anlev=trip;70;30

tab accom region;anlev=hhold;wm=1
tab sex age;anlev=person;wm=2
tab mode destin;anlev=trip;wm=3

l waccom1;anlev=hhold
col 106;House;Flat

l waccom2;anlev=person
col 106;House;Flat

l waccom3;anlev=trip
col 106;House;Flat
See also
Defining weighting matrices in hierarchical data