turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Using Formats Created with PROC FORMAT as a Groupi...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-16-2016 12:48 PM

Can you use a format that was created with Proc Format in PROC BOXPLOT in oder to compare several groups associated with the format "bins" into which you have divided the grouping variable.

PROC FORMAT ;

VALUE LEVELS

0 <- 2 = 'A'

2 <- 6 = 'B'

6 <- 10 = 'C'

10 <- 12 = 'D'

12 <- 16 = 'E';

RUN;

PROC FREQ

DATA = QUIZDATA ;

TABLES NLEVELS / PLOTS = FREQPLOT ;

FORMAT NLEVELS LEVELS. ;

RUN;

The format works well with PROC FREQ.

How would you use it with PROC BOXPLOT as I just wish to compare the five groups A -E and not all the individual values.

If one actually creates a new variable by binning the variable NLEVELS using the same groups as in PROC FORMAT

then you can use this new variable in PROC BOXPLOT for comparison.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to JonDickens1607

05-16-2016 01:30 PM

A box plot shows the distribution of a continuous variable. What is the continuous variable here? I am assuming that you want to create five box plots, one each for A-E?

If there is a continuoius variable called Y, you can create five box plots like this

proc boxplot data=quizdata;

FORMAT NLEVELS LEVELS. ;

PLOT Y*NLEVELS;

run;

If you are trying to visualize the distribution within each group, then try this:

data A / view=A;

Grade = NLEVELS; /* copy continuous variable */

run;

proc boxplot data=A;

FORMAT NLEVELS LEVELS. ;

PLOT Grade*NLEVELS;

run;