|
|
Hello Brian,
I think you can test the syntax. It is certainly not elegant, but I believe it is functional. bye bye
Luciano Basso University of São Paulo
Laboratory of Motor Behaviour.
**** 1. Create a variable: START_DATE. compute start_date=DATE.DMY(1,7,2009). format start_date(date). EXECUTE.
*** 2. Calculate the number of weeks.
COMPUTE week=DATEDIF(date,START_DATE, "weeks"). VARIABLE LABEL week. VARIABLE LEVEL week (SCALE). FORMATS week (F5.0). VARIABLE WIDTH week(5). EXECUTE.
*** 3. Separate each "Elapsed_Time" in their respective weeks.
IF (week=1) Week_1=Elapsed_Time. IF (week=2) Week_2=Elapsed_Time. IF (week=3) Week_3=Elapsed_Time. IF (week=4) Week_4=Elapsed_Time. IF (week=5) Week_5=Elapsed_Time. IF (week=6) Week_6=Elapsed_Time.
IF (week=7) Week_7=Elapsed_Time. IF (week=8) Week_8=Elapsed_Time. IF (week=9) Week_9=Elapsed_Time. IF (week=10) Week_10=Elapsed_Time. IF (week=11) Week_11=Elapsed_Time. IF (week=12) Week_12=Elapsed_Time.
IF (week=13) Week_13=Elapsed_Time. EXECUTE.
|