尝试使用PROC PANEL时,我收到了一个非常令人沮丧的SAS错误。
“期待名字”
我创建了一些重现错误的示例代码。关于我缺少的任何想法?
876 PROC SORT DATA=TEMP OUT=TEMPSORTED;
877 BY OBS_DATE;
878 RUN;
NOTE: There were 26 observations read from the data set WORK.TEMP.
NOTE: The data set WORK.TEMPSORTED has 26 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
879
880 PROC PANEL DATA=TEMPSORTED;
881 ID OBS_DATE;
_
22
****ERROR 22-322: Expecting a name.****
882 LAG DEGREES_F(1) / OUT=TEMP_W_LAG;
ERROR: Variable NAME not found.
883 RUN;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PANEL used (Total process time):
real time 0.06 seconds
cpu time 0.00 seconds
以下是重现错误的整段代码:
DATA TEMP;
INPUT OBS_DATE mmddyy10. DEGREES_F @17;
FORMAT OBS_DATE mmddyy10.;
datalines;
11/01/2014 44
11/02/2014 53
11/03/2014 64
11/04/2014 61
11/05/2014 63
11/06/2014 52
11/07/2014 45
11/08/2014 49
11/09/2014 53
11/10/2014 65
11/11/2014 61
11/12/2014 33
11/13/2014 31
11/14/2014 29
11/15/2014 33
11/16/2014 33
11/17/2014 25
11/18/2014 21
11/19/2014 33
11/20/2014 30
11/21/2014 36
11/22/2014 54
11/23/2014 54
11/24/2014 51
11/25/2014 30
11/26/2014 32
;
PROC SORT DATA=TEMP OUT=TEMPSORTED;
BY OBS_DATE;
RUN;
PROC PANEL DATA=TEMPSORTED;
ID OBS_DATE;
LAG DEGREES_F(1) / OUT=TEMP_W_LAG;
RUN;
答案 0 :(得分:1)
Proc Panel适用于数据是时间序列和横截面的情况。您的数据似乎不是横截面的,而是单独的时间序列。
此外,ID还需要横截面ID和时间变量。您可以尝试简单地添加横截面ID,看看它是否能满足您的需求,但您可能希望探索其他更合适的程序。