hello,
my aim is avg cumulative daily counts of cow births over 5 years. I know how, but my problem is that I want to graph these counts over time and my data set only contains records of cow births/ dates, not all possible dates in the time period. Eg no birth on 2 jan in any of those 5 years =no record for 2 jan. I need a date spine. Is there any way to include all possible dates in a year without typing them all?
THanks
Hi
Could you please provide a sample data and the expected output
Thanks,
Jag
To create dates is easy:
data dates2012;
do date='01Jan2012'd to '31DEC2012'd by 1;
output;
end;
run;
What type of graph are you attempting to create? Generally any time axis for an entire year would have too many entries for readability. Scatter plots don't care much about missing x axis values and you can generally use a "from date to date by interval" type of description. Series plots may or may not have breaks depending on the procedure and what you want things to look like.
Having done some similar types of cumulative to day of year, you might find looking at Julian Dates are also helpful.
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.