BookmarkSubscribeRSS Feed
tejeshwar
Calcite | Level 5
I have a numeric variable which has a range. The variable also has some special values like -999984. Is there a way I can get descriptive statistics on this variable based on automatic groups of 10 set by SAS. for ex:

Groups N Mean Minimum Maximum
-999994 - 0 45
1-3 123
4-9 23

Thanks
Tej
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
SAS PROC FORMAT is one option to generate a list of value ranges associated with some descriptive relationship. Then use PROC SUMMARY/MEANS to summarize the FORMATTED CLASS variable.

Scott Barry
SBBWorks, Inc.
tejeshwar
Calcite | Level 5
Proc Format is one of the option, however in that case I will need to see range of every variable and create these groups manually. Since I am dealing with 250 variables and every single one of them has a different range, so this is something I am hoping to avoid.

Something that I am hoping is if SAS can decide these groups by itself depending upon the range and then I can summarize it.

I am sure there might be a way, however just I am not able to figure it out by myself.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Look at using PROC SUMMARY to generate the MIN and MAX in a new file. Then MERGE that file back onto your original file. Then using a DATA step, increment in a DO loop from your new TO variables BY 10, creating another new variable which you will then use to run your descriptive statistics.

You may also find the SAS support website http://support.sas.com/ useful with its own SEARCH facility (SAS DOC and technical papers are hosted there), and possibly using the Google advanced search argument below (one one of your own):

generate descriptive statistics value ranges site:sas.com


Scott Barry
SBBWorks, Inc.
tejeshwar
Calcite | Level 5
Possibly in case you have a sample code, that should be helpful

Tej

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 677 views
  • 0 likes
  • 2 in conversation