Hi, I need assistance with creating categorical time group (intervals) variables to be used in logistic regression.
Similar to the way you would create an AGEGROUP variable. I'm currently using SAS Studio.
Here is my code so far:
Data BK4;
set BK3;
FORMAT Timeconsumed time6.;
if Timeconsumed ge 10:30 and ln 11:30 then LunchPeriod1= 1;
else LunchPeriod1= 0;
if Timeconsumed ge 11:30 and ln 12:30 then LunchPeriod2= 1;
else LunchPeriod2= 0;
if Timeconsumed ge 12:30 and ln 13:30 then LunchPeriod3= 1;
else LunchPeriod3= 0;
if Timeconsumed ge 13:30 and ln 14:30 then LunchPeriod4= 1;
else LunchPeriod4= 0;
if Timeconsumed ge 14:30 then LunchPeriod5= 1;
else LunchPeriod5= 0;
else= .;
run;
I keep getting these error messages:
ERROR 22-322: Syntax error, expecting one of the following: <, <=, =, >, >=, EQ, GE, GT, LE, LT, NE, NG, NL, ^=, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
Any help would be much appreciated!