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 (March 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 7 Mar 2002 11:04:57 -0800
Reply-To:   Cassell.David@EPAMAIL.EPA.GOV
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "David L. Cassell" <Cassell.David@EPAMAIL.EPA.GOV>
Subject:   Re: SAS CODE FOR RANDOMIZATION TEST FOR TWO INDEPENDENT SAMPLES!
Content-type:   multipart/mixed; Boundary="0__=88256B750067E69E8f9e8a93df938690918c88256B750067E69E"

"Mr. J. Simakani" <Simakani.acd.UTT.UTR@GETAFIX.UTR.AC.ZA> wrote: > Could anyone please supply me with a SAS code to carry out a > randomization test(nonparametric test) for two independent samples.

Here's some SAS code to do a randomization test on almost any test SAS can generate in a proc. These macros form a wrapper about the desired proc. I'll be talking about this at SUGI in April. I hope you don't mind attachments; they're short.

(See attached file: Rand_gen.sas)(See attached file: rand_anl.sas)

And here's a simple example showing how to use the macros. Just take whatever proc you wanted to run the randomization test on, and insert the statement "BY REPLICATE;" in it. Then, in the rand_anl.sas macro call, specify the records to be tested in the output data set:

%include 'rand_gen.sas'; %include 'rand_anl.sas';

%rand_gen(indata=yb98fish,outdata=outrand,depvar=FishS,numreps=1000,seed=12345678);

proc glm data=outrand noprint outstat=outstat1; by replicate; class habitat; model FishS = habitat; means habitat / tukey hovtest ; run;

%rand_anl(randdata=outstat1,where=_source_='Habitat' and _type_='SS3',testprob=prob, testlabel=Model F test);

In my talk at SUGI, I'll show how to use this in more detail, explain how the macro wrapper works, and show how to use this in more sophisticated situations [including an ODS dataset].

David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician


Rand_gen.sas [application/octet-stream]

rand_anl.sas [application/octet-stream]


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