| Date: | Sat, 14 May 2005 22:12:31 +0200 |
| Reply-To: | Robbins <robbins@O2.PL> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Robbins <robbins@O2.PL> |
| Organization: | Wroclaw University of Technology, Poland |
| Subject: | Re: Do you recommed this source .. |
|
I'm immensely indebted to all for comments and suggestion.
I should explain why I intend to learn macros. I wrote programs in MATLAB.
But statistics there is very poor. Also , because my university buy SAS
licence I decided to quit writing codes in MATLAB and I choose SAS. In SAS I
would like to write my own code, as well - e.g. simulation (Monte Carlo).
But I noticed that SAS does not allow to write code like this:
do i=1 to 1000;
proc something;
.......
run;
proc something;
.......
proc something;
.......
run;
run;
end;
It is immposible to nested proc, data and so on.
I bought book: SAS for Monte Carlo Studies (Fan, Felsovalyi, Silvo, Keenan).
But there are only macros.I tried to modify code to simulate 2 variables X
and Y from independent normal pdf. Next I count Pearson's correlation. But I
can't to figure out how to repeat this 200 times to get 200 Pearson's
correl. Therefore I thought that I should learn macro. Does anybody know how
to do it. Program is (it's a pity that I can't write: repeat 200 my program
end;)
DATA DAT;
DO I=1 TO 1000;
X=RANNOR(0);
Y=RANNOR(0);
OUTPUT;
END;
*** use PROC CORR to get Pearson r, results as SAS
dataset PEARSON;
PROC CORR DATA=DAT NOPRINT OUTP=PEARSON;
VAR X Y;
RUN;
DATA PEARSON; SET PEARSON;
IF _NAME_='X';
CORR=Y;
KEEP CORR;
run;
Thank you vary much
Rob
|