I need to create a timeseries graph (using PROC SGPLOT at the moment) that plots monthly counts of workplace incidents from 2000 to 2010.
The problem I am having is that I don't know how to organise the data in order to have the xaxis showing YEAR and MONTH.
At the beginning I have the following variables: DATE, YEAR, MONTH, INCIDENT_ID.
I successfully used PROC SQL to create counts of distinct INCIDENT_ID grouped by YEAR and MONTH (called 'COUNT'). I then unsuccessfully created a PROC SGPLOT using YEAR or MONTH for the xaxis, but this does not plot COUNT correctly. I then tried sorting the data set by YEAR, MONTH and created an TIME_ID variable that put them in order, and tried using this as the x-axis. While it plots COUNT correctly, it does not provide an understandable x-axis.
Therefore I have my counts (COUNT) that I want to plot in a PROC SGPLOT series, but what do I use as the x-axis to have it show YEAR and/or MONTH of COUNT? Or is there some obvious other way to do this?