BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
statiswak
Fluorite | Level 6

Hello,

I need to find the time period (3 month increments; Jan-Mar, Feb-Apr, etc.) where the majority of my data points (rates) are. The dataset extends 2 years. Would it be best to create a graph/visualization such as a scatterplot? Or use a proc freq statement on the dates? Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

If you have a date associated with the measures then 1) make sure it is a SAS date value (NOT character or numeric like 20180120 that only looks date-like) and 2) use a format like YYQ6. for the variable.

Then procs like Freq will group the variables into calendar quarters and display the value like 2017Q1 (first quarter of 2017)

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

"majority of data points" might mean something different to me than it means to you

 

Nevertheless, I can think of two approaches

  1. Histograms (bar charts) of the data
  2. Run PROC UNIVARIATE and use the MODE that is computed (MODE is the value occurs the most)
--
Paige Miller
statiswak
Fluorite | Level 6

Thank you!

ballardw
Super User

If you have a date associated with the measures then 1) make sure it is a SAS date value (NOT character or numeric like 20180120 that only looks date-like) and 2) use a format like YYQ6. for the variable.

Then procs like Freq will group the variables into calendar quarters and display the value like 2017Q1 (first quarter of 2017)

statiswak
Fluorite | Level 6

Thank you. The proc freq did the trick. I did a cross-tabulation, so I could see the frequency of the ID's by date and quarter.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 660 views
  • 2 likes
  • 3 in conversation