1643 2

[有偿编程] 时间序列的绘图 [推广有奖]

  • 4关注
  • 8粉丝

本科生

37%

还不是VIP/贵宾

-

威望
0
论坛币
2451 个
通用积分
2.8429
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1021 点
帖子
51
精华
0
在线时间
125 小时
注册时间
2016-10-15
最后登录
2020-12-7

50论坛币
我想去除图中的轴线,有没有语句或关键词可用?就是一格格灰色的实线,不是虚线。如果有怎么调整字体大小等也同求啊。代码如下:
proc arima data=p plots(only)=(forecast(forecast));
        /*预测,残差p>0.05,模型的价值已提取完毕*/
        identify var=k_likelihood(1);/*进行一阶差分,nlag=6*/
        estimate p=0 q=0 method=ml;
        forecast lead=10 id=year1 interval=year out=f1;
run;
quit;
数据为:
year1k_likelihood

2002/11/10

3.05796189

2003/11/10

2.83128728

2004/11/10

2.56487122

2005/11/10

1.87106964

2006/11/10

2.13975211

2007/11/10

0.8112924

2008/11/10

0.02282331

2009/11/10

-0.1704331

2010/11/10

-0.4598498

2011/11/10

-0.7117507

2012/11/10

-1.6526958

2013/11/10

-2.0288599

2014/11/10

-2.4791082

2015/11/10

-2.6726061

2016/11/10

-3.1237542



上男.jpg
关键词:时间序列 Likelihood Forecast estimate Interval
沙发
l1i2n3i4n5g 在职认证  发表于 2018-3-17 14:27:54 |只看作者 |坛友微信交流群
no grid
  1. data p;
  2. format year1 yymmdd10.;
  3. input
  4. year1 :yymmdd10.
  5. / k_likelihood;
  6. cards;
  7. 2002/11/10
  8. 3.05796189
  9. 2003/11/10
  10. 2.83128728
  11. 2004/11/10
  12. 2.56487122
  13. 2005/11/10
  14. 1.87106964
  15. 2006/11/10
  16. 2.13975211
  17. 2007/11/10
  18. 0.8112924
  19. 2008/11/10
  20. 0.02282331
  21. 2009/11/10
  22. -0.1704331
  23. 2010/11/10
  24. -0.4598498
  25. 2011/11/10
  26. -0.7117507
  27. 2012/11/10
  28. -1.6526958
  29. 2013/11/10
  30. -2.0288599
  31. 2014/11/10
  32. -2.4791082
  33. 2015/11/10
  34. -2.6726061
  35. 2016/11/10
  36. -3.1237542
  37. ;
  38. run;

  39. proc template;                                                               
  40.    define statgraph Ets.Arima.Graphics.ForecastPlot;
  41.       dynamic title ConfidenceLabel integerTime variable PlotAct lead horizon
  42.          printall _byline_ _bytitle_ _byfootnote_;                           
  43.       BeginGraph;                                                            
  44.          EntryTitle TITLE / pad=(bottom=5) TEXTATTRS=(size=10);/*改title字体大小*/
  45.          Layout Overlay / YAXISOPTS=(display=all TICKVALUEATTRS=(size=10) LABELATTRS=(size=10) Label=   
  46.             "Forecast") XAxisOpts=(display=all TICKVALUEATTRS=(size=10) LABELATTRS=(size=10) linearopts=
  47.             (Integer=INTEGERTIME));/*改tickvalue、label字体大小*/                                       
  48.             BandPlot limitlower=LOWERCL limitupper=UPPERCL x=TIME / display=(
  49.                fill) fillattrs=GRAPHCONFIDENCE datatransparency=0.5 name=     
  50.                "Conf" LegendLabel=CONFIDENCELABEL;                           
  51.             if (PLOTACT > 0)                                                  
  52.                ScatterPlot x=TIME y=ACTUAL / markerattrs=GRAPHDATADEFAULT name
  53.                   ="Actual" legendlabel="Actual";                             
  54.             endif;                                                            
  55.             if (PRINTALL)                                                     
  56.                if (LEAD > 0)                                                  
  57.                   ReferenceLine x=HORIZON / lineattrs=GRAPHREFERENCE (pattern=
  58.                      dash) name="Vline" legendlabel=                          
  59.                      "Start of multi-step forecasts";                        
  60.                endif;                                                         
  61.             endif;                                                            
  62.             SeriesPlot x=TIME y=FORECAST / primary=true lineattrs=GRAPHFIT (  
  63.                Thickness=1px) name="Predicted" legendlabel="Predicted";      
  64.             DiscreteLegend "Actual" "Predicted" "Conf" "Vline" / valueATTRS=(size=10);/*改legend字体大小*/            
  65.          EndLayout;                                                           
  66.          if (_BYTITLE_)                                                      
  67.             entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;                  
  68.          else                                                                 
  69.             if (_BYFOOTNOTE_)                                                
  70.                entryfootnote halign=left _BYLINE_;                           
  71.             endif;                                                            
  72.          endif;                                                               
  73.       EndGraph;                                                               
  74.    end;                                                                       
  75. run;

  76. proc arima data=p plots(only)=(forecast(forecast));
  77.         /*预测,残差p>0.05,模型的价值已提取完毕*/
  78.         identify var=k_likelihood(1);/*进行一阶差分,nlag=6*/
  79.         estimate p=0 q=0 method=ml;
  80.         forecast lead=10 id=year1 interval=year out=f1;
  81. run;
  82. quit;
复制代码


已有 1 人评分论坛币 收起 理由
mikeleung110 + 1 精彩帖子

总评分: 论坛币 + 1   查看全部评分

使用道具

l1i2n3i4n5g 发表于 2018-3-18 10:49
大兄弟。收下我的膝盖。妈呀。服气服气
已有 1 人评分论坛币 收起 理由
mikeleung110 + 1 精彩帖子

总评分: 论坛币 + 1   查看全部评分

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 15:09