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 17:39:41 -0500
Reply-To:   help ly <help.ly2005@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   help ly <help.ly2005@GMAIL.COM>
Subject:   help: printing list with blocks (groups)
Content-Type:   text/plain; charset=ISO-8859-1

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