|
楼主
楼主 |
发表于 2003-9-29 20:34:33
|
只看该作者
实例:X11过程进行离群值诊断和剔除
/****************************************************************/
/* SAS SAMPLE LIBRARY */
/* */
/* NAME: x11ex3 */
/* TITLE: X11: Outlier Detection and Removal */
/* PRODUCT: ETS */
/* SYSTEM: ALL */
/* KEYS: time series analysis, seasonal adjustment, */
/* PROCS: X11 */
/* DATA: */
/* */
/* REF: */
/* MISC: */
/* */
/****************************************************************/
/* Example 19.3 Outlier Detection and Removal */
/* Chapter 19 page 937 */
data a;
retain seed 99831;
do kk = 1 to 48;
x = kk + 100 + rannor( seed );
date = intnx( 'month', '01jan70'd, kk-1 );
if kk = 20 then x = 2 * x;
else if kk = 30 then x = x / 10;
output;
end;
run;
proc x11 data=a;
monthly date=date additive
fullweight=3.0 zeroweight=3.5;
var x;
table d9;
output out=b b1=original e1=e1;
run;
symbol1 i=join v=plus;
symbol2 i=join v=diamond;
legend1 label=none value=('unmodified' 'modified');
proc gplot data= b;
plot original * date = 1 e1 * date = 2 / overlay legend=legend1;
format date monyy.;
run; |
|