University of Rochester Medical Center
SearchDirectoryNewsEventsStrong HealthURMC Home
 

SAS Helpful Hints

Biostat Macro Library

Randomization

%Random resides in the departments SAS Macro Library and is enabled with the following SAS statements:

Libname biostat '\\BIO2\example\SASMacrosWindows';
Options Mstored SasMstore=biostat;

%Random creates a SAS saveset with blocked random treatment assignments by stratification factor. Order of assignment within block is also created.

Syntax:
%Random(dataset,treatments,stratas,blocks,firstid,seed);
    dataset:        Dataset to create.
    treatments:   Number of treatments.
    stratas:         Number of stratification groups.
    blocks:         List of block sizes within stratification group.
    firstid:           Starting ID number.
    seed:            Random Seed.

Example:
%Random(work.A,4,25,8 4 4 4,1001,12345);

 

Please send your comments and suggestions about this web page to A. Watts (watts@bst.rochester.edu)