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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.