BookmarkSubscribeRSS Feed
awmk
Calcite | Level 5

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

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

Hi

Could you please provide a sample data and the expected output

Thanks,

Jag

Thanks,
Jag
ballardw
Super User

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-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 575 views
  • 0 likes
  • 3 in conversation