Let's Get Social!
Focal Point    Focal Point Forums    WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] box and whisker plot
 Go New Search Notify Tools Reply
 [SOLVED] box and whisker plot
Member
 posted October 10, 2018 02:59 PM
What would be the best way to get the data needed for a box and whisker plot? They have a function for Median but not the other quartiles.

Any ideas?

This message has been edited. Last edited by: FP Mod Chuck,

WebFOCUS 8
Windows, All Outputs

 Posts: 16 | Registered: April 13, 2017 IP
Expert
 posted October 10, 2018 04:46 PM Hide Post
A box and whisker plot-also called a box plot-displays the five-number summary of a set of data. The five-number summary is the minimum, first quartile, median, third quartile, and maximum. In a box plot, we draw a box from the first quartile to the third quartile. A vertical line goes through the box at the median.

I hope this helps.

 Posts: 3052 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005 IP
Member
 posted October 11, 2018 09:19 AM Hide Post
No that didnt help. I an not sure how to calculate the quartiles...

WebFOCUS 8
Windows, All Outputs

 Posts: 16 | Registered: April 13, 2017 IP
Virtuoso
 posted October 11, 2018 09:32 AM Hide Post

 Posts: 1752 | Location: New York City | Registered: December 30, 2015 IP
Member
 posted October 11, 2018 09:46 AM Hide Post
So I know what a box and whisker plot is and I know what is needed to make one.

My question is not what are the data points in it.

My question is how to calculate said data points.

IB has a function for calculating the median but as far as I can tell they dont have it for calculating the first, or third quartiles. I also know how to calculate the min and max. I dont know how to get IB to calculate the quartiles properly.

WebFOCUS 8
Windows, All Outputs

 Posts: 16 | Registered: April 13, 2017 IP
Member
 posted October 11, 2018 09:57 AM Hide Post
So I found this:

https://techsupport.informatio...cof/cof_tcn_073.html

But when I put in my parameters I get this:

(FOC958) ATTEMPT TO USE ONLINE COMMAND IN BATCH MODE FAILED

WebFOCUS 8
Windows, All Outputs

 Posts: 16 | Registered: April 13, 2017 IP
Expert
 posted October 11, 2018 10:16 AM Hide Post
Use the min. and max. prefix operators on the fields to get the min and max values.

Ref: 'F1' Help from AppStudio (may be available using "http://localhost:8080/ibi_apphelp/index.jsp"), search for 'prefix operators'

 Posts: 3052 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005 IP
Expert
 posted October 11, 2018 10:19 AM Hide Post
quote:
calculating the first, or third quartiles

Try this to calculate q1 and q3?

1: Put the numbers in order. ...
2: Find the median. ...
3: Place parentheses around the numbers above and below the median. Not necessary statistically, but it makes Q1 and Q3 easier to spot. ...
4: Find Q1 and Q3. ...
5: Subtract Q1 from Q3 to find the interquartile range.

 Posts: 3052 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005 IP
Member
 posted October 11, 2018 10:26 AM Hide Post
Could you provide an example using the car file or something? I need to be able to calculate Q1 and Q3 programatically so that it can be automated

WebFOCUS 8
Windows, All Outputs

 Posts: 16 | Registered: April 13, 2017 IP
Platinum Member
 posted October 12, 2018 08:18 AM Hide Post
Here's an example I did a few years ago. Notice the

IN-GROUPS-OF 4 TILES

for calculating quartiles. Reference this Doc.
Scroll down to Grouping Numeric Data Into Tiles section.

``` SET PAGE=NOLEAD,STYLE=ENDEFLT,BYDISPLAY=ON,ASNAMES=ON

TABLE FILE ibisamp/ggsales
PRINT SEQ_NO
BY REGION
BY DOLLARS AS 'SALES'
IN-GROUPS-OF 4 TILES
ON TABLE HOLD AS quartiles
END

TABLE FILE quartiles
SUM MAX.SALES AS 'MAXSALES'
MIN.SALES AS 'MINSALES'
ACROSS HIGHEST TILE
BY REGION
ON TABLE HOLD AS maxmin
END

GRAPH FILE maxmin
SUM MAXSALES4
MAXSALES3
MAXSALES2
MAXSALES1
MINSALES1
BY REGION
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH BOXPLOT
ON GRAPH SET STYLE *
INCLUDE=endeflt.sty,\$
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setTextRotation(getO1Label(),0);
setDisplay(getO1MajorGrid(),false);
setTransparentFillColor(getFrame(),true);
setBorderColor(getY1MajorGrid(),new Color(220,220,220));
*END
ENDSTYLE
END
```

WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF

 Posts: 146 | Registered: October 19, 2010 IP
Member
 posted October 17, 2018 11:32 AM Hide Post
Thanks! This is what I was looking for and its wayyy simpler than what I had come up with. Ill convert my code to use this method instead.

WebFOCUS 8
Windows, All Outputs

 Posts: 16 | Registered: April 13, 2017 IP