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
October 10, 2018, 04:46 PM
Doug
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.
October 11, 2018, 09:19 AM
Monika Acosta
No that didnt help. I an not sure how to calculate the quartiles...
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.
(FOC958) ATTEMPT TO USE ONLINE COMMAND IN BATCH MODE FAILED
WebFOCUS 8 Windows, All Outputs
October 11, 2018, 10:16 AM
Doug
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'
October 11, 2018, 10:19 AM
Doug
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.
October 11, 2018, 10:26 AM
Monika Acosta
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
October 12, 2018, 08:18 AM
dbeagan
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
WebFOCUS 8.2.06
October 17, 2018, 11:32 AM
Monika Acosta
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.