r*********o 发帖数: 490 | 1 我用的code框架如下,sas总是崩溃,有啥好办法?
ods listing close;
ods output ttests=pvals;
proc ttest data=sashelp.class;
class sex;
var col1-col20000;
run;
ods output close;
ods listing; |
m*********n 发帖数: 413 | |
s*r 发帖数: 2757 | |
m*********n 发帖数: 413 | 4 完全竖起来会很慢吧
【在 s*r 的大作中提到】 : 把data竖起来by process
|
s*r 发帖数: 2757 | 5 不知道,知道我就收费啦
【在 m*********n 的大作中提到】 : 完全竖起来会很慢吧
|
r*********o 发帖数: 490 | 6 你是说把data transpose吗,那样怎么做ttest啊 |
o****o 发帖数: 8077 | 7 作T检验,只需要三个统计量嘛,N,MEAN,STD
先求summarized statistics,再用BY-processing。跑得时间不见得少,不过至少不会
崩溃。而且这个用BY-PROCESSING可以很容易并行,最后合并结果也很容易。
134
135
136 options fullstimer;
137 data class;
138 set sashelp.class;
139 array col{20000};
140 do j=1 to dim(col); col[j]=rannor(0); end;
141 drop j;
142 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 20005 variables.
NOTE: DATA statement used (Total process time):
real time 0.10 seconds
user cpu time 0.09 seconds
system cpu time 0.00 seconds
memory 11727.75k
OS Memory 86552.00k
Timestamp 05/21/2012 11:02:44 PM
143
144 proc means data=class noprint nway;
145 class sex;
146 var col1-col20000;
147 output out=_mean(where=(_STAT_ in ('MEAN', 'STD', 'N'))) ;
148 run;
NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: The data set WORK._MEAN has 6 observations and 20004 variables.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.26 seconds
user cpu time 0.18 seconds
system cpu time 0.10 seconds
memory 87692.78k
OS Memory 149208.00k
Timestamp 05/21/2012 11:02:45 PM
149
150
151 proc sort data=_mean;
152 by _STAT_ sex;
153 run;
NOTE: There were 6 observations read from the data set WORK._MEAN.
NOTE: The data set WORK._MEAN has 6 observations and 20004 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.05 seconds
user cpu time 0.03 seconds
system cpu time 0.06 seconds
memory 13924.31k
OS Memory 88660.00k
Timestamp 05/21/2012 11:02:45 PM
154 proc transpose data=_mean out=_mean2;
155 by _stat_ sex;
156 var col1-col20000;
157 run;
NOTE: There were 6 observations read from the data set WORK._MEAN.
NOTE: The data set WORK._MEAN2 has 120000 observations and 4 variables.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
real time 0.08 seconds
user cpu time 0.06 seconds
system cpu time 0.03 seconds
memory 10370.34k
OS Memory 85432.00k
Timestamp 05/21/2012 11:02:45 PM
158 proc sort data=_mean2; by _name_ sex; run;
NOTE: There were 120000 observations read from the data set WORK._MEAN2.
NOTE: The data set WORK._MEAN2 has 120000 observations and 4 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.07 seconds
user cpu time 0.07 seconds
system cpu time 0.00 seconds
memory 7343.00k
OS Memory 84156.00k
Timestamp 05/21/2012 11:02:45 PM
159 data _mean2;
160 set _mean2; by _name_;
161 retain id 0;
162 if first._name_ then id+1;
163 run;
NOTE: There were 120000 observations read from the data set WORK._MEAN2.
NOTE: The data set WORK._MEAN2 has 120000 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 330.67k
OS Memory 78524.00k
Timestamp 05/21/2012 11:02:45 PM
164
165 ods select none;
166 ods output ttests=pvals;
167 proc ttest data=_mean2 ;
168 by _name_;
169 class sex;
170 var col1;
171 *where id<=2000;
172 run;
NOTE: The data set WORK.PVALS has 40000 observations and 7 variables.
NOTE: PROCEDURE TTEST used (Total process time):
real time 1:04:55.51
user cpu time 8:30.82
system cpu time 51:23.90
memory 1806236.67k
OS Memory 1894844.00k
Timestamp 05/22/2012 12:07:40 AM
173 ods select all;
【在 s*r 的大作中提到】 : 不知道,知道我就收费啦
|
m*********n 发帖数: 413 | 8 楼主的电脑内存多少。。
【在 s*r 的大作中提到】 : 不知道,知道我就收费啦
|