"Expecting a Name" (SAS) 过程面板

"Expecting a Name" (SAS) Proc Panel

我在尝试使用 PROC PANEL 时收到一个非常令人沮丧的 SAS 错误。

"Expecting a name"

我创建了一些重现错误的示例代码。关于我遗漏的任何想法?

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;

Proc 面板适用于数据既是时间序列又是横截面数据的情况。您的数据似乎不是横截面数据,而是时间序列数据。

此外,ID 还需要横截面 ID 和时间变量。您可以尝试简单地添加一个横截面 ID,看看是否能满足您的需求,但您可能想要探索其他更合适的过程。