|
The question was originally posted here:
http://groups.google.com/group/comp.soft-sys.sas/browse_frm/thread/4356220ede78bec9?lnk=igtc
Since I have updated information so I figure it deserves a new thread.
With help from Tree Frog (http://groups.google.com/groups/profile?
enc_user=gu8o6xYAAAAU22r-HHvnGqNjH8TtB_Kqo4cocwWvDVg2RHsu8f1bCg)
I managed to run hundreds PHREG procedure in one key touching and SAS
would produce single output as following:
SUMMARY INFORMANTION
FOR 1
Sample Size = 60 Probability = 0.4 DELTA = 0.5 SEED = 539
09:25 Tuesday, August
28, 2007
Variable Estimate
1 2.29375
2 2.77788
3 3.30085
4 17.81447
5 4.57152
6 17.93637
7 17.85846
8 17.85846
9 17.93092
10 18.01070
^L SUMMARY INFORMANTION
FOR 2
Sample Size = 60 Probability = 0.4 DELTA = 0.5 SEED = 259
09:25 Tuesday, August
28, 2007
Variable Estimate
1 1.87794
2 2.73585
3 3.84799
4 3.59480
5 3.79974
6 4.13830
7 17.16902
8 17.17453
9 17.18101
10 3.69323
^L SUMMARY INFORMANTION
FOR 3
Sample Size = 60 Probability = 0.4 DELTA = 0.5 SEED = 59
09:25 Tuesday, August
28, 2007
Variable Estimate
1 3.26335
2 3.20653
3 4.71742
4 4.71742
5 3.05631
6 3.45821
7 3.82824
8 4.32400
9 4.35616
10 3.27526
.....
....more output for different combinations of parameters...
....
However I would want output for different seed numbers are merged
into
one table, i.e., in the following form:
SUMMARY INFORMANTION
FOR 1
Sample Size = 60 Probability = 0.4 DELTA = 0.5
09:25 Tuesday, August
28, 2007
Variable Seed539 Seed259 Seed59
1 2.29375 1.87794 3.26335
2 2.77788 2.73585 3.20653
3 3.30085 3.84799 4.71742
4 17.81447 3.59480 4.71742
5 4.57152 3.79974 3.05631
6 17.93637 4.13830 3.45821
7 17.85846 17.16902 3.82824
8 17.85846 17.17453 4.32400
9 17.93092 17.18101 4.35616
10 18.01070 3.69323 3.27526
The SAS code that generates these output are:
%macro myphregmacro(U=,P=,DELTA=,SEED=);
ods output ParameterEstimates=myEstimate
(keep=Variable Estimate);
%*My SAS code for a single run of PHREG;
proc print data=myEstimate;
TITLE1' SUMMARY INFORMANTION FOR';
TITLE2"Sample Size = &U Probability = &P DELTA = &DELTA SEED =
&SEED";
run;
%put &sample &delta &p_c &seed;
%mend;
data _null_;
array mysamplesize(3) (60 120 180);
array myp_c(5) (0.0 0.4 0.6 0.8 1.0);
array mydelta(7) (0.5 0.8 1.0 1.2 1.5 1.8 2.0);
array myseed(3) (539 259 59);
do s=1 to dim(mysamplesize);
do p=1 to dim(myp_c);
do d=1 to dim(mydelta);
do se=1 to dim(myseed);
call execute('%MYPHREGMACRO(U='||
mysamplesize(s)||',P='||myp_c(p)||',DELTA='||mydelta(d)||',seed='||
myseed(se)||')');
end;
end;
end;
end;
run;
I tried to use method suggested here:
http://www2.sas.com/proceedings/sugi31/261-31.pdf
to merge Estimate columns for three seed numbers without success. If I
do
DATA NEWDATA;
SET myEstimate;
by Variable;
RUN
PROC PRINT;
inside the macro (after the TITLE2 statement, I got only result from
last seed in data NEWDATA;
if I do this data step in just after the first "end;" of the loop, the
program even won't run.
How do I merge statistics from a macro generated multiple SAS
procedures then? Thanks!
p.s. For the particular project, I have already merged the dataset
manually in Excel, it was tedious. I just want to learn the technique
in order I want to alter the parameters in the future.
Jindan
|