Hey Community,
I'm trying to mimic a table box in a report like you get with TukeyHSD in Fit Y by X, but I'm running into a problem with the bar chart drawn in a PlotColBox. Bar lengths are plotted with confidence intervals for each bar. My problem is that I want the bars to be drawn from the origin so that you can visually see where the lower confidence limit dips below 0 (indicating a non-significant result), but the bars are being drawn from the minimum value on the scale. I cannot find anything in the scripting index to modify this behavior.
Ultimately, it should closely resemble the plot in this ordered differences report:
Here's what I am getting (minimal working example shown here):
I set the range on the horizontal axis on the plot using << Set Scale and setting it equal to the min LCL and max UCL so that he plot will be wide enough to show all of the LCL and UCL values, but this causes the bars to be drawn starting at the same minimum value.
Here's a script for the minimal working example:
diffs = {14.5833333333333, 13.25, 13.1666666666667, 12.4166666666667, 11.8333333333333,
11.75, 11, 10.4166666666667, 9.58333333333333, 2.83333333333333, 2.16666666666667,
1.41666666666667, 1.41666666666667, 1.33333333333333, 0.833333333333334};
lcls = {7.61907259396521, 8.36035077512539, 6.22561115938687, 7.05705972526408,
6.99299436545608, 4.7114849776621, 5.68093889133607, 5.37459986573576,
4.09680778320344, -0.348570126295593, -5.63501808685501, -1.64446371477212,
-1.1943038377427, -6.25265936207625, -5.48781669649702};
ucls = {21.5475940727015, 18.1396492248746, 20.1077221739465, 17.7762736080693,
16.6736723012106, 18.7885150223379, 16.3190611086639, 15.4587334675976,
15.0698588834632, 6.01523679296226, 9.96835142018835, 4.47779704810545,
4.02763717107603, 8.91932602874292, 7.15448336316369};
New Window("Results",
tb = Table Box(
Number Col Box("Difference", diffs),
Number Col Box("LCL", lcls),
Number Col Box("UCL", ucls),
Number Col Box("p-Value", p_vals[sort], Set Format(7, 97), Set Conditional Format("pValue")),
Plot Col Box("", diffs, Upper(matrix(ucls)), Lower(matrix(lcls)), Set Scale(min(lcl), max(ucl)))
)
);
Thanks in advance for the help!