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

I have a variable for hourly earnings which respondents can answer with accuracy to the penny. So the mean is like $27, but toward the bottom there is so much small variation in reporting, so it has one person at $11.61 one person at $11.63 two people at $11.67, etc.. but when you get higher there's just clumps of people at $15.00 and $25.00.

 

So if I graph it, the chart has many more values at the low end and it skews the chart. Is there a way to automatically recode them to all be in clumps increasing by $0.50 or something (without manually recoding hundreds of ranges)?

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

You would still have a skewed distribution, but you could use the round function to adjust the salaries. e.g.:

 

data have;
  input salary;
  datalines;
11.53
11.48
12.10
12.49
12.74
12.75
;

data want;
  set have;
  round_salary=round(salary,0.5);
run;

Art, CEO, AnalystFinder.com

 

View solution in original post

2 REPLIES 2
Reeza
Super User

ROUND(variable, 0.50)

 

I thought that's what a histogram did? It bins it automatically? 

 

 

art297
Opal | Level 21

You would still have a skewed distribution, but you could use the round function to adjust the salaries. e.g.:

 

data have;
  input salary;
  datalines;
11.53
11.48
12.10
12.49
12.74
12.75
;

data want;
  set have;
  round_salary=round(salary,0.5);
run;

Art, CEO, AnalystFinder.com

 

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
  • 361 views
  • 0 likes
  • 3 in conversation