BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
LABRADOR
Obsidian | Level 7

Hi, how do I create a frequency and a percent frequency table with a class width of 5 (i.e. 65.0-69.9) for median income using SAS 9.4

State Median
Income
Alabama 76.2
Alaska 98.4
Arizona 79.7
Arkansas 70.9
California 91.2
Colorado 89.3
Connecticut 107.5
Delaware 90.2
Florida 75.5
Georgia 79.7
Hawaii 89.7
Idaho 67.1
Illinois 89.7
Indiana 76.7
Iowa 81.3
Kansas 79.9
Kentucky 76.4
Louisiana 82.6
Maine 77.8
Maryland 108.5
Massachusetts 106.8
Michigan 81
Minnesota 89.9
Mississippi 70.4
Missouri 77
Montana 73.6
Nebraska 78.3
Nevada 75.1
New Hampshire 93.9
New Jersey 110.7
New Mexico 77.6
New York 95.2
North Carolina 76.5
North Dakota 87
Ohio 80.9
Oklahoma 74.5
Oregon 78.7
Pennsylvania 86.8
Rhode Island 94.9
South Carolina 77.1
South Dakota 72
Tennessee 73.4
Texas 82
Utah 75
Vermont 83.1
Virginia 97.2
Washington 91.6
West Virginia 76.8
Wisconsin 82.3
Wyoming 87.9
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Use custom formats and then PROC FREQ.

 

proc format;
    value inc 60-<65 = '60-64.9' 65-<70='65-69.9' /*etc.*/
    ;
run;
proc freq data=have;
    tables median_income;
    format median_income inc.;
run;
--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

Use custom formats and then PROC FREQ.

 

proc format;
    value inc 60-<65 = '60-64.9' 65-<70='65-69.9' /*etc.*/
    ;
run;
proc freq data=have;
    tables median_income;
    format median_income inc.;
run;
--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 221 views
  • 1 like
  • 2 in conversation