data a;
attrib lab subject visit value coin label=" "
value format=5.3;
seed=4329;
do lab="实验A", "实验B", "实验C";
do subject=1 to 8;
do visit=0, 1, 3, 4, 6;
value=input(10*rannor(seed)+25, 5.3);
coin=rantbl(seed,0.5,0.5);
if NOT (subject in(2,6) and visit in(4.5, 6))
and NOT (subject in(7) and visit in(1,3,4.5)) then do;
if visit=0 or coin=1
then output;
end;
end;
end;
end;
drop seed coin;
run;
data b;
do lab="实验A", "实验B", "实验C";
do subject=1 to 8;
do visit=0, 1, 3, 4, 6;
output;