全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3879 9
2009-02-26
<p>data zlh;<br/>  input air@@;<br/>  date=intnx('month','1jan49'd,_n_-1);<br/>  format date monyy.;<br/>  cards;<br/>  112 118 132 129 121 135 148 148 136 119 104 118 <br/>  115 126 141 135 125 149 170 170 158 133 114 140 <br/>  145 150 178 163 172 178 199 199 184 162 146 166<br/>  171 180 193 181 183 218 230 242 209 191 172 194<br/>  196 196 236 235 229 243 264 302 293 259 229 203<br/>  229 242 233 267 269 270 315 364 347 312 274 237 <br/>  278 284 277 317 313 318 374 413 405 355 306 271 <br/>  306 315 301 348 355 422 465 467 404 347 305 336 <br/>  315 301 356 348 355 422 465 467 404 347 305 336 <br/>  340 318 362 348 363 435 491 505 404 359 310 337 <br/>  360 342 406 396 420 472 548 559 463 407 362 405 <br/>  417 391 419 461 472 535 622 606 508 461 390 432<br/>  ;<br/>run;<br/>proc gplot data=Zlh;<br/> symbol1 i=join v=dot c=red;<br/> plot air*date=1;<br/>run;<br/>data lair;<br/> set Zlh;<br/> lair=log(air);<br/>run;<br/>proc gplot data=lair;<br/> symbol2 i=spline c=green;<br/> plot lair*date=2;<br/>run;<br/>proc arima data=lair;<br/> identify var=lair nlag=36;<br/>run;<br/>proc arima data=lair;<br/> identify var=lair(1) nlag=36;<br/>run;<br/>proc arima data=lair;<br/> identify var=lair(1,12) nlag=36;<br/>run;<br/>proc arima data=lair;<br/> identify var=lair(1,12) nlag=36;<br/> estimate q=(1)(12) noconstant method=uls plot;<br/>run;<br/>proc arima data=lair;<br/> identify var=lair(1,12) nlag=36;<br/> estimate q=(1)(12) noconstant method=uls plot;<br/> forecast lead=36 interval=month id=date out=b;<br/>run;<br/>proc print data=b;<br/>run;<br/>data lair;<br/>set b;<br/>air=exp(lair);<br/>forecast=exp(forecast+std*std/2);<br/>l95=exp(l95);<br/>u95=exp(u95);<br/>run;<br/>proc print data=lair;<br/>run;<br/>proc gplot data=lair<font color="#f73809" size="4">;{<strong>就是从这里开始做不下去了,做出来就是最下面这样的提示</strong>}<br/></font>symbol1 I=none v=star r=1 c=red;<br/>symbol2 I=join v=plus r=1 c=green;<br/>symbol3 I=join v=none l=3 r=1 c=blue;<br/>proc gplot data=lair;<br/>where data>=’1jan59’d;<br/>plot air*date=1 forecast*date=2 l95*date=3 u95*date=3/<br/>overlay haxis=’1jan59’d to ‘1jan62’d by year;<br/>run;</p><p><font size="3">{<font color="#4822dd">551  proc gplot data=lair;<br/>552  where data>=’1jan59’d;<br/>ERROR: Variable data is not on file WORK.LAIR.<br/>NOTE: SCL source line.<br/>553  plot air*date=1 forecast*date=2 l95*date=3 u95*date=3/overlay haxis=’1jan59’d to ‘1jan62’d by year;</font></font></p><p><font color="#4822dd" size="3">                                                                                     --<br/>                                                                                     22<br/>                                                                                        -----------<br/>                                                                                        202<br/>ERROR: "’1JAN59’D" is not a valid name.<br/>NOTE: The previous statement has been deleted.<br/>ERROR 22-322: Syntax error, expecting one of the following: ;, ANNOTATE, AREAS, AUTOHREF, AUTOVREF, C, CAXIS, CFRAME, CHREF,<br/>              COUTLINE, CTEXT, CVREF, DATAORDER, DESCRIPTION, FRAME, HAXIS, HMINOR, HREF, HTML, HTML_LEGEND, HZERO, IFRAME,<br/>              IMAGESTYLE, LEGEND, LHREF, LVREF, NAME, NOAXIS, NOFRAME, NOLEGEND, OVERLAY, REGEQN, SKIPMISS, VAXIS, VMINOR, VREF,<br/>              VREVERSE, VZERO.<br/>ERROR 202-322: The option or parameter is not recognized and will be ignored.<br/>554  run;</font></p><p><font color="#4822dd" size="3">ERROR: At least one PLOT or BUBBLE statement must be given.}</font></p><p><font color="#4822dd" size="3">请大家告诉是什么问题,我是按书上来的,可是就是做不出来最后的预测图,</font></p>
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-2-26 11:13:00
data zlh;
  input air@@;
  date=intnx('month','1jan49'd,_n_-1);
  format date monyy.;
  cards;
  112 118 132 129 121 135 148 148 136 119 104 118
  115 126 141 135 125 149 170 170 158 133 114 140
  145 150 178 163 172 178 199 199 184 162 146 166
  171 180 193 181 183 218 230 242 209 191 172 194
  196 196 236 235 229 243 264 302 293 259 229 203
  229 242 233 267 269 270 315 364 347 312 274 237
  278 284 277 317 313 318 374 413 405 355 306 271
  306 315 301 348 355 422 465 467 404 347 305 336
  315 301 356 348 355 422 465 467 404 347 305 336
  340 318 362 348 363 435 491 505 404 359 310 337
  360 342 406 396 420 472 548 559 463 407 362 405
  417 391 419 461 472 535 622 606 508 461 390 432
  ;
run;
proc gplot data=Zlh;
 symbol1 i=join v=dot c=red;
 plot air*date=1;
run;
data lair;
 set Zlh;
 lair=log(air);
run;
proc gplot data=lair;
 symbol2 i=spline c=green;
 plot lair*date=2;
run;
proc arima data=lair;
 identify var=lair nlag=36;
run;
proc arima data=lair;
 identify var=lair(1) nlag=36;
run;
proc arima data=lair;
 identify var=lair(1,12) nlag=36;
run;
proc arima data=lair;
 identify var=lair(1,12) nlag=36;
 estimate q=(1)(12) noconstant method=uls plot;
run;
proc arima data=lair;
 identify var=lair(1,12) nlag=36;
 estimate q=(1)(12) noconstant method=uls plot;
 forecast lead=36 interval=month id=date out=b;
run;
proc print data=b;
run;
data lair;
set b;
air=exp(lair);
forecast=exp(forecast+std*std/2);
l95=exp(l95);
u95=exp(u95);
run;
proc print data=lair;
run;
proc gplot data=lair;
symbol1 I=none v=star r=1 c=red;
symbol2 I=join v=plus r=1 c=green;
symbol3 I=join v=none l=3 r=1 c=blue;
proc gplot data=lair;
where date>='1jan59'd;
plot air*date=1 forecast*date=2 l95*date=3 u95*date=3/
overlay haxis='1jan59'd to '1jan62'd by year;
run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-2-26 11:14:00
这回试试
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-2-26 12:08:00
proc gplot data=lair;{就是从这里开始做不下去了,做出来就是最下面这样的提示}
symbol1 I=none v=star r=1 c=red;
symbol2 I=join v=plus r=1 c=green;
symbol3 I=join v=none l=3 r=1 c=blue;
proc gplot data=lair;

where data>=’1jan59’d;(童鞋。。变量名叫date,不是data!)

plot air*date=1 forecast*date=2 l95*date=3 u95*date=3/
overlay haxis=’1jan59’d to ‘1jan62’d by year;
run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-2-26 13:07:00
lz,偶个人认为,用 sas 之 ARIMA 过程 作时间序列预测并不是一个好的选择,推荐用 SPSS ,这方面 SPSS 比 SAS 直观,操作简单,而预测结果与残差均可保存为单独的列变量,而 SAS 就没有这方面的优势。所以,建议 LZ 不妨试一试SPSS 之 ARIMA。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-2-26 13:25:00
楼上,谁和你说SAS不能保存预测结果和残差?
我就经常做预测值与真实值的比较图和残差图。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群