Z:\to_server\website\mrdcl-learning.com\mrdcl_files\TAB-103\run13d.stp
start data,
serial number in columns 1,2,3,
card characters 100,
ds $gender=$5/1,2,
x='Male;
Female',
xt='Gender',
ds $age=$6/1-3,
x='Under 35;
36-54;
55+',
xt='Age',
!
di $price=$7-8,
xt='Cost',
finish data,
start tables,
t #rimacc(f=nptb/dbl)=$gender*$age,
t #rim1(f=nptb/nitb/dbl)=$gender*,
t #rim2(f=nptb/nitb/dbl)=$age*,
t #rimwt(f=dpt2/ptb/nitb/dbl)=$gender*$age,
>>  Warning at line 26 in Z:\to_server\website\mrdcl-learning.com\mrdcl_files\TAB-103\run13d.stp
>>  Last few chars parsed were {,t#rim2(f=nptb/nitb/dbl)=$age*,t#rimwt(f=dpt2/ptb/}
>>W 360 Format already set to this value
finish tables,
start manip,
mt #rim1=(100,50,50),
mt #rim2=(100,40,40,20),
mt #rimwt=%rim(u,#rimacc,#rim1,#rim2),
finish manip,
start tables,
f=dbl,
ds $rimext=$gender.by.$age,
dw $weight=$rimext(#rimwt),
! It is good practice to produce weighted
! tables to check that the weighting has
! been applied correctly
select wr 1,
t #unw=$gender*$age,
select wr $weight,
t #wtd(f=dpt1)=$gender*$age,
! The main tables for the run would be here
finish tables,
