Hi there - thanks a lot for your help! Unfortunately, I ran into some problems with your code: When I ran the code as you posted it, there seemed to be a problem with method=none and the three following lines. 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 proc expand data=have out=want method=none
70 align=beginning
71 from=month
72 to=month4
73 ;
74 by group;
75 id date;
76 convert value=meanvalue / transformout=( movave 4 );
77 run;
ERROR: The option METHOD=NONE can only be used when no frequency conversion is specified by the TO= or FACTOR= option.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.WANT may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.WANT was not replaced because this step was stopped. Because of this error message, I took the method = none part out of the code. However, when I did that I ran into the following problem: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 proc expand data=have out=want
70 align=beginning
71 from=month
72 to=month4
73 ;
74 by group;
75 id date;
76 convert value=meanvalue / transformout=( movave 4 );
77 run;
ERROR: The data set WORK.HAVE is not sorted by the ID variable. At observation number 13, date=01JAN2021, but date=01DEC2021 for
the previous observation.
NOTE: The above message was for the following BY group:
Group=1
ERROR: The data set WORK.HAVE is not sorted by the ID variable. At observation number 37, date=01JAN2021, but date=01DEC2021 for
the previous observation.
NOTE: The above message was for the following BY group:
Group=2
NOTE: There were 48 observations read from the data set WORK.HAVE.
NOTE: The data set WORK.WANT has 0 observations and 3 variables. Because it said the dataset was not sorted by the ID variable, I tried ordering by date and group and ran the code again ( I receive the same error message when ordering by date and person): 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 proc sort data=have;
70 by date group;
71 run;
72
73 proc expand data=have out=want
74 align=beginning
75 from=month
76 to=month4
77 ;
78 by group;
79 id date;
80 convert value=meanvalue / transformout=( movave 4 );
81 run;
ERROR: Observation with duplicate ID value found. The value of the ID variable, date=01JAN2021, at observation number 2 in data set
WORK.HAVE is the same as the previous observation.
NOTE: The above message was for the following BY group:
Group=1
ERROR: Observation with duplicate ID value found. The value of the ID variable, date=01JAN2021, at observation number 4 in data set
WORK.HAVE is the same as the previous observation.
ERROR: Data set WORK.HAVE is not sorted in ascending sequence. The current BY group has Group = 2 and the next BY group has Group =
1.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 5 observations read from the data set WORK.HAVE.
WARNING: The data set WORK.WANT may be incomplete. When this step was stopped there were 0 observations and 3 variables.
WARNING: Data set WORK.WANT was not replaced because this step was stopped.
I also tried running the code with method=none instead of from=month to=month4 part, but this also did not work. First, ordered by date and group: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 proc expand data=have out=want method=none
70 align=beginning;
71 by group;
72 id date;
73 convert value=meanvalue / transformout=( movave 4 );
74 run;
ERROR: Observation with duplicate ID value found. The value of the ID variable, date=01JAN2021, at observation number 2 in data set
WORK.HAVE is the same as the previous observation.
NOTE: The above message was for the following BY group:
Group=1
ERROR: Observation with duplicate ID value found. The value of the ID variable, date=01JAN2021, at observation number 4 in data set
WORK.HAVE is the same as the previous observation.
ERROR: Data set WORK.HAVE is not sorted in ascending sequence. The current BY group has Group = 2 and the next BY group has Group =
1.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.WANT may be incomplete. When this step was stopped there were 0 observations and 6 variables.
WARNING: Data set WORK.WANT was not replaced because this step was stopped.
NOTE: PROCEDURE EXPAND used (Total process time): Second, ordered by group and person: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 proc expand data=have out=want method=none
70 align=beginning;
71 by group;
72 id date;
73 convert value=meanvalue / transformout=( movave 4 );
74 run;
ERROR: The data set WORK.HAVE is not sorted by the ID variable. At observation number 13, date=01JAN2021, but date=01DEC2021 for
the previous observation.
NOTE: The above message was for the following BY group:
Group=1
ERROR: The data set WORK.HAVE is not sorted by the ID variable. At observation number 37, date=01JAN2021, but date=01DEC2021 for
the previous observation.
NOTE: The above message was for the following BY group:
Group=2
NOTE: The data set WORK.WANT has 0 observations and 6 variables. I feel like the problem is that I basically have two groups: person with 12 observations each and then the actual group consisting of the individual people. Is there a way to solve this problem?
... View more