|
Something like this perhaps.
proc plan seed=1267697419;
factors block=4 ordered treatment=5 / noprint;
output out=plan treatment cvals=('AABB' 'ABAB' 'BBAA' 'ABAB' 'BAAB');
run;
data plan;
set plan;
length subjid $3.;
subjid = put(_n_,z3.);
run;
proc print;
run;
On 2/27/09, help ly <help.ly2005@gmail.com> wrote:
> Try to print a list of 20 randomized treatments. Using blocking size of 4,
> so total there will be 5 loops. So far I only obtained the ouput like
> this:
> * i block*
> 1 AABB
> 2 ABAB
> 3 BBAA
> 4 ABAB
> 5 BAAB
> Here are my codes:
>
> data bio2.Tril2;
> do i = 1 to 5;
> if ranuni(123456789) le 1/6 then block = 'AABB';
> else if ranuni(123456789) le 1/3 then block = 'ABAB';
> else if ranuni(123456789) le 1/2 then block = 'BAAB';
> else if ranuni(123456789) le 2/3 then block = 'BABA';
> else if ranuni(123456789) le 5/6 then block = 'BBAA';
> else block = 'AABB';
> output;
> end;
> run;
> proc print data = bio2.Tril2 noobs;
> title 'Group Assignment for Tril II';
> run;
>
> But, Need to print it like below:
>
> *Subject* *Group*
>
> 1 A
>
> 2 B
>
> .
>
> .
> 20 A
>
> Is there a good way to do this in SAS ?
> --
> Thanks so much!
>
> Orange
> help.ly2005@gmail.com
>
|