Hi,
I am trying to create a time series plot that includes dates and hours. I want to show the trend by hour and by date.
Currently I have used proce template with data lattice to do this:
proc template;
define statgraph Day_Hour;
begingraph;
layout gridded / border=false ;
layout datalattice columnvar=date / headerlabeldisplay=value border=false columnheaders=bottom columnaxisopts=(label="Date" )
cellwidthmin=10 cellheightmin=10
;
layout prototype /walldisplay=(fill) ;
seriesplot x=hour y=count /display=(markers) break=false markerattrs=graphdata1(symbol=circlefilled size=9)
lineattrs=graphdata1;
endlayout;
endlayout;
endlayout;
endgraph;
end;
run;
Hwoever, I want the trend line to connect across days and with data lattice it breaks between each day. I want the last hour of September 29th to connect with the first hour of Sepetmber 28th.
Do you know how I can get my trend line to connect, but still show dates and hours.
Do you really want " I want the last hour of September 29th to connect with the first hour of Sepetmber 28th."
Did you mean " I want the last hour of September 28th to connect with the first hour of Sepetmber 29th."?
For continuous plots involving date and time I would ensure that I had a SAS date time variable.
You could make a datetime variably using the DHMS function:
DT = DHMS(date, hour,0,0);
in a data step.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.