Whiskers2 worksheet
Author: Mike May, S.J.
Date: December 22, 2008

We are exploring some of the features of the pre-release with a boxplot

More notes

ListSize1 = 11 (slider from 3 to 43, step 1)
VL_1 = Sequence(Random[0.000000000000000, 100.0000000000000 + n 0.000000000000000], n, 1.000000000000000, ListSize1)
ListSize2 = Length(VL_1)
Q1A: floor((ListSize2 + 2.000000000000000) / 4.000000000000000)
VL_2 = Sort(VL_1)
MP1: floor((ListSize2 + 1.000000000000000) / 2.000000000000000)
MP2: ceil((ListSize2 + 1.000000000000000) / 2.000000000000000)
text1: "There are " + ListSize2 + " elements in the list."
MedianOdd: "Since there are an odd number of elements in the list,
the median is the middle or " + MP2 + "th element
of the list."
MedianEven: "Since there are an even number of elements in the list,
there is no middle element of the list.  Thus the 
median is the average of the " + MP1 + "th and " + MP2 + "th elements."
LSM4 = Mod(ListSize2, 4.000000000000000)
LSM2 = Mod(ListSize2, 2.000000000000000)
Q1B: floor(ListSize2 / 4.000000000000000 + 1.000000000000000)
Q3A: ListSize2 + 1.000000000000000 - Q1B
Q3B: ListSize2 + 1.000000000000000 - Q1A
Q1Odd: "Since there are an odd number of elements before 
the median, the first quartile is the " + Q1A + "th 
element of the list, or the middle element of the 
elements of the list before the median."
Q1Even: "Since there are an even number of elements before 
the median, the first quartile is the average of the " + Q1A + "th, and the " + Q1B + "th
element of the list."
Q3Odd: "Since there are an odd number of elements after 
the median, the third quartile is the " + Q3A + "th 
element of the list, or the middle element of the
 elements of the list after the median."
Q3Even: "Since there are an even number of elements after 
the median, the first quartile is the average of the " + Q3A + "th, and the " + Q3B + "th
element of the list."
C_1 = Corner(1.000000000000000)
C_2 = Corner(3.000000000000000)
E_1: 0.9000000000000000 C_1 + 0.1000000000000000 C_2
E_2: (0.1000000000000000 x(C_1) + 0.9000000000000000 x(C_2), 0.9000000000000000 y(C_1) + 0.1000000000000000 y(C_2))
LtX: x(E_1)
RtX: x(E_2)
MinX = Element(VL_2, 1.000000000000000)
MaxX = Element(VL_2, ListSize2)
VL_3: LtX + (VL_2 - MinX) / (MaxX - MinX) * (RtX - LtX)
VL_4 = Sequence((Element[VL_3, n], y(E_1)), n, 1.000000000000000, ListSize2)
BoxPlot = BoxPlot(y(E_1), 0.5000000000000000, VL_3)
Med = Median(VL_1)
Quartile1 = Q1(VL_1)
Quartile3 = Q3(VL_1)
MedianValueText: "The median is " + Med
text3: "The values are " + VL_2
Q1ValueText: "The first quartile is " + Quartile1
Q3ValueText: "The third quartile is " + Quartile3
YLevel: y(C_1)
MinLine = Segment((LtX, y(E_1) - 1.000000000000000), (LtX, y(E_1) + 1.000000000000000))
MaxLine = Segment((RtX, y(E_1) - 1.000000000000000), (RtX, y(E_1) + 1.000000000000000))
MedX: LtX + (Med - MinX) / (MaxX - MinX) * (RtX - LtX)
MinXValue: "min value " + MinX
MaxXValue: "max value " + MaxX
MedXValue: "median value " + Med
Q1X: LtX + (Quartile1 - MinX) / (MaxX - MinX) * (RtX - LtX)
Q3X: LtX + (Quartile3 - MinX) / (MaxX - MinX) * (RtX - LtX)
MedLine = Segment((MedX, y(E_1) - 1.000000000000000), (MedX, y(E_1) + 1.000000000000000))
Q1Line = Segment((Q1X, y(E_1) - 1.000000000000000), (Q1X, y(E_1) + 1.000000000000000))
Q3Line = Segment((Q3X, y(E_1) - 1.000000000000000), (Q3X, y(E_1) + 1.000000000000000))
Q1XValue: "Q1 value " + Quartile1
Q3XValue: "Q3 value " + Quartile3
Half1 = First(VL_2, MP2 - 1.000000000000000)
Half2 = Sequence(Element[VL_2, n], n, MP1 + 1.000000000000000, ListSize2)
Last1 = First(VL_2, 3.000000000000000)
Quarter1 = First(Half1, Q1B - 1.000000000000000)
Quarter3 = First(Half2, Q1B - 1.000000000000000)
Quarter2 = Sequence(Element[Half1, n], n, Q1A + 1.000000000000000, MP2 - 1.000000000000000)
Quarter4 = Sequence(Element[Half2, n], n, Q1A + 1.000000000000000, MP2 - 1.000000000000000)
Quarter1Text: "Quarter1 values " + Quarter1
Quarter3Text: "Quarter3 values " + Quarter3
Quarter2Text: "Quarter2 values " + Quarter2
Quarter4Text: "Quarter4 values " + Quarter4