全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
6509 3
2012-02-25
具体的形式是
月份         2000年   2001年   2002年    2003年
1
2
3
4
5
6
7
8
9
10
11
12
中间是数据,我编程时在time=intnx('monrh','01jan2000'd, _n_-1);这个地方不知道怎么改,才能够包括2001年、2002年、2003年的内容呢?求指教谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2015-4-8 13:39:17
The form of the INTNX function is

INTNX ( interval, from, n < , alignment > ) ;
The arguments to the INTNX function are as follows:

interval
is a character constant or variable that contains an interval name

from
is a SAS date value (for date intervals) or datetime value (for datetime intervals)

n
is the number of intervals to increment from the interval that contains the from value

alignment
controls the alignment of SAS dates, within the interval, used to identify output observations. Allowed values are BEGINNING, MIDDLE, END, and SAMEDAY.

The number of intervals to increment, n, can be positive, negative, or zero.

For example, the statement NEXTMON=INTNX(’MONTH’,DATE,1) assigns to the variable NEXTMON the date of the first day of the month following the month that contains the value of DATE. Thus INTNX(’MONTH’,’21OCT2007’D,1) returns the date 1 November 2007.
二维码

扫码加我 拉你入群

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

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

2015-4-8 15:25:21

data m;
input month y2000 y2001 y2002 y2003;
CARds;
1 19 19 19 19
2 90 90 90 90
3 10 10 10 10
4 25 25 25 25
5 19 19 19 19
6 90 90 90 90
7 10 10 10 10
8 25 25 25 25
9 19 19 19 19
10 90 90 90 90
11 10 10 10 10
12 25 25 25 25
;
proc transpose data=m out=m name=year prefix=data;
by month;
var y2000-y2003;
run;
proc sort data=m;
by year;
run;
data m;
set m(keep=data1);
time=intnx('month','01jan2000'd,_n_-1);
format time yymon7.;
run;
proc gplot data=m;
plot data1*time;
symbol i=join;
run;
二维码

扫码加我 拉你入群

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

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

2015-4-8 15:35:35
/*接上(1)绘制该序列时序图ji样本自相关图
(2)判断该序列的平稳性
(3)判断该序列的纯随机性*/
proc arima data=m;
identify var=data1 stationarity= (adf=1);/*3个要求都在里面了*/
run;
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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