Data visualization with SAS programming

BOXPLOT with BLOCK but using summary datasets input

Reply
New Contributor
Posts: 2

BOXPLOT with BLOCK but using summary datasets input

Hello,

I am trying to use PROC boxplot with BLOCK statments,

it works fine while using raw data.

But it seems dosen't work while using the BOX data.

For example:

/*Using the raw data, outputs - box_raw*/

proc boxplot data=eg_out1;

    plot EGRN*n(abbr VISID)/outbox=out1;

run;

/*Using the BOX data, outputs - box_box*/

proc boxplot box=out1;

    plot EGRN*n(abbr VISID);

run;

The boxplots parts  in both outputs are the same, but the BLOCK parts is incorrect while using the BOX data inputs.

Is there any way to solve this ?

Thank you!


box_box.PNGbox_raw.PNG
Respected Advisor
Posts: 3,786

Re: BOXPLOT with BLOCK but using summary datasets input

Maybe you just need to sort the data by the BLOCK variables.

SAS Employee
Posts: 8

Re: BOXPLOT with BLOCK but using summary datasets input

Hi Howard,

It's difficult for me to determine what's going on without seeing the data.  Note that block variables are intended to identify blocks of box-and-whisker charts.  The values of the block variables (abbr and VISIS) should be the same for all observations contributing to one box, i.e. those with the same value of the group variable, n.  Does your data fit that description?

Bucky

New Contributor
Posts: 2

Re: BOXPLOT with BLOCK but using summary datasets input

Hello,

To  Bucky:

The raw data is like this:

EGRN.  abbr.  visid.   n

10.         PBO.  20.     1

25          PBO.  20.     1

16          PBO.  20.     1

...

18.         TRT1. 20.     2

14.         TRT1. 20.     2

23          TRT1. 20.     2

...

16          TRT2. 20.     3

...

29          PBO . 30.     4

...

17          TRT1 . 30.     5

...

And the dataset out1 is something like this:

n  _type_      _var_   _value_  abbr.  visid

1     N           EGRN     201      PBO   20

1    MEAN    EGRN    21.2      PBO   20

1    MAX       EGRN    24        PBO   20

...

2     N           EGRN     211      TRT1   20

2    MEAN    EGRN    23.2      TRT1   20

2    MAX       EGRN    25        TRT1   20

...

3     N           EGRN     281      TRT2   20

3    MEAN    EGRN    21.2      TRT2   20

3    MAX       EGRN    29        TRT2   20

...

4     N           EGRN     219      PBO   30

4    MEAN    EGRN    22.2      PBO   30

4    MAX       EGRN    27        PBO   30


...

n is simply a dummy variable, and dataset out1 is the

summary datasets of the raw data using PROC BOXPLOT, and I think

the data fit the description.


To data _null_ :


I'll try to sort the BLOCK variable tomorrow, and let you know if it works or not.


Thank you!


Ask a Question
Discussion stats
  • 3 replies
  • 341 views
  • 0 likes
  • 3 in conversation