LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 27 Feb 2009 18:33:55 -0600
Reply-To:   "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: help: printing list with blocks (groups)
Comments:   To: help ly <help.ly2005@gmail.com>
In-Reply-To:   <39377cce0902271439i36dc5c4fmcf76aa60a4c7970f@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

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 >


Back to: Top of message | Previous page | Main SAS-L page