Programming the statistical procedures from SAS

'Conditional' incomplete block design

Accepted Solution Solved
Reply
Contributor
Posts: 38
Accepted Solution

'Conditional' incomplete block design

hi all,

im not sure where to post this so ill start here.

i want to create an incomplete block design. i have 8 treatments A-H. i need to create 3 blocks of size 2.

now here is where im getting it stuck. there are treatment pairs that cannot be separated. in other words, A/B need to stay together, C/D, E/F, and G/H. so out of those four pairs i need to pick 3 pairs and i have to replicate this 50 times. i need all the pairs to be distributed equally and uniformly.

so for example replicate 1 may look like

Block 1Block 2Block 3
AEC
BFD

replicate 2 would may like

Block 1Block 2Block 3
EAC
FBD

any thoughts???


Accepted Solutions
Solution
‎05-21-2013 10:56 PM
Respected Advisor
Posts: 3,124

Re: 'Conditional' incomplete block design

Since you haven't stated clearly if the order of treatments matters, so here is the combination version of the code. If it does matter, then use permutation version of it.

data _null_;

   array x(4) $2  ('AB' 'CD' 'EF' 'GH');

   seed = 1234567890123;

   do n=1 to 50;

      call rancomb(seed, 3, of x1-x4);

      put seed= @20 ' x= ' x1-x3;

   end;

run;

Haikuo

View solution in original post


All Replies
Respected Advisor
Posts: 3,773

Re: 'Conditional' incomplete block design

If the pairs can't be separated doesn't that mean you really only have 4 "treatments"?

Solution
‎05-21-2013 10:56 PM
Respected Advisor
Posts: 3,124

Re: 'Conditional' incomplete block design

Since you haven't stated clearly if the order of treatments matters, so here is the combination version of the code. If it does matter, then use permutation version of it.

data _null_;

   array x(4) $2  ('AB' 'CD' 'EF' 'GH');

   seed = 1234567890123;

   do n=1 to 50;

      call rancomb(seed, 3, of x1-x4);

      put seed= @20 ' x= ' x1-x3;

   end;

run;

Haikuo

Respected Advisor
Posts: 2,655

Re: 'Conditional' incomplete block design

Thanks !  This was the perfect code reminder for a completely separate place and project--I had forgotten about rancomb and ranperm, and PROC PLAN was driving me nuts.

Steve Denham

SAS Super FREQ
Posts: 3,310

Re: 'Conditional' incomplete block design

Not only random permutations, but also ordered sets of permutations:

http://blogs.sas.com/content/iml/2010/10/13/generate-all-permutations-in-sas/

By the way,  in SAS/IML software the ALLCOMB, ALLPERM, RANCOMB, and RANPERM functions work on arbitrary sets, not just integers 1:n.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 160 views
  • 3 likes
  • 5 in conversation