I have updated it. It gives the average number of occurrence on a given day of the week. Code is self explanatory. Replace my proc sql by the following two steps: /* This counts the occurence */ proc sql; create table have3 as select Location ,day format mmddyy9., dow , put(Hour, tod5.) as Hour, count(hour) as no_on_day from have2 group by Location,day, dow,Hour; quit; /* The number average number of occurrences on a given location, time and day. dow is day o f week. */ proc sql; select location, dow, hour, avg(no_on_day) as avg from have3 group by Location, dow,hour; quit; I have written the code to match the appearance of your question.
... View more