C:\to_server\website\mrdcl-learning.com\mrdcl_files\TAB-102\run13b.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#actual(f=nptb/nptr/nptc/nrtv)=$age * $gender,
t#target(f=nptb/nitb/nptr/nptc/nrtv/dpt1)=$age * $gender,
t#factor(f=nitb/nptr/nptc/nrtv/dpt1)=$age * $gender,
t#sample(f=nptb)=*,
finish tables,
start manip,
!!!THIS TARGETS TO PERCENTAGES RATHER THAN ACTUAL NUMBERS
mt#target(r1-$,c1-$)=(10.0,12.5,12.5,40.0,15.0,10.0),
dw $totsamp=#sample(r0,c0),
mt#factor(r1-$,c1-$)=#target(r1-$,c1-$) / #actual(r1-$,c1-$) * $totsamp / 100.0,
dw $check=#actual(r1,c1),
if $check/0.0,list 'This cell is empty - Row 1 Column 1',
if $check/0,stop,
dw $check=#actual(r1,c2),
if $check/0.0,list 'This cell is empty - Row 1 Column 2',
if $check/0,stop,
dw $check=#actual(r2,c1),
if $check/0.0,list 'This cell is empty - Row 2 Column 1',
if $check/0,stop,
dw $check=#actual(r2,c2),
if $check/0.0,list 'This cell is empty - Row 2 Column 2',
if $check/0,stop,
dw $check=#actual(r3,c1),
if $check/0.0,list 'This cell is empty - Row 3 Column 1',
if $check/0,stop,
dw $check=#actual(r3,c2),
if $check/0.0,list 'This cell is empty - Row 3 Column 2',
if $check/0,stop,
finish manip,
start tables,
ds $wtmatrix=$age.by.$gender,
dw $weight=$wtmatrix(#factor),
select wr $weight,
t#1(f=dpt1/nrtv/rtt/dpr1)=$age * $gender,
finish tables,
