qesuite 1.0.49 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +46 -12
- package/dist/index.mjs +46 -12
- package/index.ts +53 -13
- package/package.json +1 -1
- package/versions/1_0_50.md +14 -0
package/dist/index.d.mts
CHANGED
|
@@ -1019,6 +1019,9 @@ declare const ANOVA: {
|
|
|
1019
1019
|
p: number;
|
|
1020
1020
|
};
|
|
1021
1021
|
};
|
|
1022
|
+
Multifactor: {
|
|
1023
|
+
MainEffectsPlot(factors: any, response: any): HTMLCanvasElement;
|
|
1024
|
+
};
|
|
1022
1025
|
};
|
|
1023
1026
|
declare function SumSquaredDeviation(data: number[], referenceValue?: any): number;
|
|
1024
1027
|
declare const Probability: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1019,6 +1019,9 @@ declare const ANOVA: {
|
|
|
1019
1019
|
p: number;
|
|
1020
1020
|
};
|
|
1021
1021
|
};
|
|
1022
|
+
Multifactor: {
|
|
1023
|
+
MainEffectsPlot(factors: any, response: any): HTMLCanvasElement;
|
|
1024
|
+
};
|
|
1022
1025
|
};
|
|
1023
1026
|
declare function SumSquaredDeviation(data: number[], referenceValue?: any): number;
|
|
1024
1027
|
declare const Probability: {
|
package/dist/index.js
CHANGED
|
@@ -2766,15 +2766,17 @@ var ANOVA = {
|
|
|
2766
2766
|
let scaleDF = Math.sqrt((rCount - 1) / (rCount * tCount));
|
|
2767
2767
|
let UDL = grandMean + pooledSTD * hAlpha * scaleDF;
|
|
2768
2768
|
let LDL = grandMean - pooledSTD * hAlpha * scaleDF;
|
|
2769
|
+
let chartSettings = new ChartSettings();
|
|
2769
2770
|
returnArray.forEach((t, x) => {
|
|
2770
2771
|
let canvasDraw = t.Mean < UDL && t.Mean > LDL ? new CanvasDrawSettings("#2183b2", "#2183b2", void 0, 0) : new CanvasDrawSettings("#F00", "#F00", void 0, 1);
|
|
2771
2772
|
let newDataSet = new DataSet([
|
|
2772
2773
|
new Point(x + 1, t.Mean, canvasDraw),
|
|
2773
2774
|
new Point(x + 1, grandMean, new CanvasDrawSettings("#000", "#000", 0, 0, 0))
|
|
2774
2775
|
], t.treatment, void 0, new Line("straight", new CanvasDrawSettings("#000", "#000", 1)));
|
|
2776
|
+
chartSettings.axis.x.customGridlines.push(new CustomGridline(x + 1, t.treatment, void 0, void 0, void 0, void 0, true));
|
|
2775
2777
|
dataSets.push(newDataSet);
|
|
2776
2778
|
});
|
|
2777
|
-
|
|
2779
|
+
chartSettings.axis.x.showAutoGridlines = false;
|
|
2778
2780
|
chartSettings.axis.y.customGridlines = [new CustomGridline(grandMean, `x\u0305\u0305=${Math.round(grandMean * 1e3) / 1e3}`, new CanvasDrawSettings(GetThemeColor(2), GetThemeColor(2)), void 0, true), new CustomGridline(LDL, `LDL=${Math.round(LDL * 1e3) / 1e3}`, new CanvasDrawSettings("#F00", "#F00"), void 0, true, void 0, true), new CustomGridline(UDL, `UDL=${Math.round(UDL * 1e3) / 1e3}`, new CanvasDrawSettings("#F00", "#F00"), void 0, true, void 0, true)];
|
|
2779
2781
|
let chart = CreateScatterPlot(dataSets, name ? `Analysis of Means for ${name}` : "Analysis of Means", chartSettings);
|
|
2780
2782
|
return {
|
|
@@ -2852,8 +2854,8 @@ var ANOVA = {
|
|
|
2852
2854
|
mean,
|
|
2853
2855
|
stdev: StDev.S(data[key]),
|
|
2854
2856
|
SE: standardError,
|
|
2855
|
-
CI_Low: mean - tInv * standardError,
|
|
2856
|
-
CI_High: mean + tInv * standardError
|
|
2857
|
+
CI_Low: mean - Math.abs(tInv * standardError),
|
|
2858
|
+
CI_High: mean + Math.abs(tInv * standardError)
|
|
2857
2859
|
};
|
|
2858
2860
|
summaryTable.ConfidenceIntervals.push(CI_table);
|
|
2859
2861
|
}
|
|
@@ -3676,6 +3678,44 @@ var ANOVA = {
|
|
|
3676
3678
|
p: Distributions.F.TwoTail(F, factor1.length - 1, factor2.length - 1)
|
|
3677
3679
|
};
|
|
3678
3680
|
}
|
|
3681
|
+
},
|
|
3682
|
+
Multifactor: {
|
|
3683
|
+
MainEffectsPlot(factors, response) {
|
|
3684
|
+
let responseName = Object.keys(response)[0];
|
|
3685
|
+
let factorKeys = Object.keys(factors);
|
|
3686
|
+
let individualCharts = [];
|
|
3687
|
+
factorKeys.forEach((k) => {
|
|
3688
|
+
let arr = factors[k];
|
|
3689
|
+
let uniqueLevels = arr.filter((value, index, array) => array.indexOf(value) === index);
|
|
3690
|
+
let dataSet = new DataSet([]);
|
|
3691
|
+
dataSet.line = new Line("straight");
|
|
3692
|
+
let chartSettings = new ChartSettings();
|
|
3693
|
+
chartSettings.axis.x.showAutoGridlines = false;
|
|
3694
|
+
chartSettings.axis.x.min = 0.5;
|
|
3695
|
+
chartSettings.axis.x.max = uniqueLevels.length + 0.5;
|
|
3696
|
+
chartSettings.axis.x.autoSize = false;
|
|
3697
|
+
uniqueLevels.forEach((level, levelI) => {
|
|
3698
|
+
let mean = 0;
|
|
3699
|
+
let N = 0;
|
|
3700
|
+
arr.forEach((v, i) => {
|
|
3701
|
+
if (v === level) {
|
|
3702
|
+
mean += response[responseName][i];
|
|
3703
|
+
N += 1;
|
|
3704
|
+
}
|
|
3705
|
+
});
|
|
3706
|
+
mean = mean / N;
|
|
3707
|
+
dataSet.values.push(new Point(levelI + 1, mean, new CanvasDrawSettings("#2183b2", "#000", void 0, void 0, 5)));
|
|
3708
|
+
chartSettings.axis.x.customGridlines.push(new CustomGridline(levelI + 1, level, void 0, void 0, void 0, true, false));
|
|
3709
|
+
});
|
|
3710
|
+
chartSettings.width += 1e3;
|
|
3711
|
+
individualCharts.push(new Chart([dataSet], "scatter", k, chartSettings));
|
|
3712
|
+
});
|
|
3713
|
+
let chartSet = new ChartSettings();
|
|
3714
|
+
chartSet.width += 1e3;
|
|
3715
|
+
chartSet.axis.y.tickOnly = true;
|
|
3716
|
+
let graph = CreateSplitGraph(individualCharts, `Main Effects Plot of ${Object.keys(response)[0]}`, chartSet);
|
|
3717
|
+
return graph;
|
|
3718
|
+
}
|
|
3679
3719
|
}
|
|
3680
3720
|
};
|
|
3681
3721
|
function SumSquaredDeviation(data, referenceValue) {
|
|
@@ -3851,7 +3891,7 @@ function AddAxisGridlines(ctx, chartSettings, axis) {
|
|
|
3851
3891
|
}
|
|
3852
3892
|
let x = ConvertToCanvasPt(unadjustedValue, chartSettings.axis.x.min, chartSettings.axis.x.max, chartSettings.width - chartSettings.margins.left - chartSettings.margins.right - (((_v = chartSettings.axis.x.padding) == null ? void 0 : _v.left) ? (_w = chartSettings.axis.x.padding) == null ? void 0 : _w.left : 0) - (((_x = chartSettings.axis.x.padding) == null ? void 0 : _x.right) ? (_y = chartSettings.axis.x.padding) == null ? void 0 : _y.right : 0), chartSettings.axis.x) + chartSettings.margins.left + (((_z = chartSettings.axis.x.padding) == null ? void 0 : _z.left) ? (_A = chartSettings.axis.x.padding) == null ? void 0 : _A.left : 0);
|
|
3853
3893
|
ctx.beginPath();
|
|
3854
|
-
ctx.moveTo(x, chartSettings.axis.x.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yT);
|
|
3894
|
+
ctx.moveTo(x, chartSettings.axis.x.tickOnly ? chartSettings.height - chartSettings.margins.bottom + 10 : yT);
|
|
3855
3895
|
ctx.lineTo(x, yB);
|
|
3856
3896
|
if (((_B = chartSettings.axis.x.labels) == null ? void 0 : _B.length) === void 0) {
|
|
3857
3897
|
chartSettings.axis.x.labels = [];
|
|
@@ -3873,9 +3913,9 @@ function AddAxisGridlines(ctx, chartSettings, axis) {
|
|
|
3873
3913
|
if (gridline.dashed) {
|
|
3874
3914
|
ctx.setLineDash([20, 15]);
|
|
3875
3915
|
}
|
|
3876
|
-
ctx.moveTo(x, gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yT);
|
|
3916
|
+
ctx.moveTo(x, gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom + 10 : yT);
|
|
3877
3917
|
ctx.lineTo(x, gridline.opposite && !gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yB);
|
|
3878
|
-
ctx.fillText(gridline.label || RoundTO(gridline.value, 3), x, gridline.opposite ? chartSettings.margins.top - 10 : chartSettings.height - chartSettings.margins.bottom +
|
|
3918
|
+
ctx.fillText(gridline.label || RoundTO(gridline.value, 3), x, gridline.opposite ? chartSettings.margins.top - 10 : chartSettings.height - chartSettings.margins.bottom + 32);
|
|
3879
3919
|
ctx.stroke();
|
|
3880
3920
|
ctx.setLineDash([]);
|
|
3881
3921
|
ctx.closePath();
|
|
@@ -4603,8 +4643,6 @@ function CreateSplitGraph(charts, title, chartSettings = new ChartSettings()) {
|
|
|
4603
4643
|
ctx.fillText(chart.title, chart.chartSettings.margins.left, chart.chartSettings.margins.top - 10);
|
|
4604
4644
|
ctx == null ? void 0 : ctx.closePath();
|
|
4605
4645
|
}
|
|
4606
|
-
chart.chartSettings.axis.x.min = NaN;
|
|
4607
|
-
chart.chartSettings.axis.x.max = NaN;
|
|
4608
4646
|
AutoAxis(chart.data, chart.chartSettings);
|
|
4609
4647
|
AddAxisGridlines(ctx, chart.chartSettings, "x");
|
|
4610
4648
|
PlotData(ctx, chart.data, chart.chartSettings);
|
|
@@ -5347,8 +5385,6 @@ function GRRRChart(data) {
|
|
|
5347
5385
|
gl.display.strokeColor = "rgb(230,230,230)";
|
|
5348
5386
|
setSettings.axis.x.customGridlines.push(gl);
|
|
5349
5387
|
}
|
|
5350
|
-
setSettings.axis.x.min = 1;
|
|
5351
|
-
setSettings.axis.x.min = Npart;
|
|
5352
5388
|
setSettings.axis.x.showAutoGridlines = false;
|
|
5353
5389
|
newDataSet.line.type = "straight";
|
|
5354
5390
|
newDataSet.line.display.strokeWidth = 2;
|
|
@@ -5432,8 +5468,6 @@ function GRRXbarChart(data) {
|
|
|
5432
5468
|
gl.display.strokeColor = "rgb(230,230,230)";
|
|
5433
5469
|
setSettings.axis.x.customGridlines.push(gl);
|
|
5434
5470
|
}
|
|
5435
|
-
setSettings.axis.x.min = 1;
|
|
5436
|
-
setSettings.axis.x.min = Npart;
|
|
5437
5471
|
setSettings.axis.x.showAutoGridlines = false;
|
|
5438
5472
|
newDataSet.line.type = "straight";
|
|
5439
5473
|
newDataSet.line.display.strokeWidth = 2;
|
package/dist/index.mjs
CHANGED
|
@@ -2674,15 +2674,17 @@ var ANOVA = {
|
|
|
2674
2674
|
let scaleDF = Math.sqrt((rCount - 1) / (rCount * tCount));
|
|
2675
2675
|
let UDL = grandMean + pooledSTD * hAlpha * scaleDF;
|
|
2676
2676
|
let LDL = grandMean - pooledSTD * hAlpha * scaleDF;
|
|
2677
|
+
let chartSettings = new ChartSettings();
|
|
2677
2678
|
returnArray.forEach((t, x) => {
|
|
2678
2679
|
let canvasDraw = t.Mean < UDL && t.Mean > LDL ? new CanvasDrawSettings("#2183b2", "#2183b2", void 0, 0) : new CanvasDrawSettings("#F00", "#F00", void 0, 1);
|
|
2679
2680
|
let newDataSet = new DataSet([
|
|
2680
2681
|
new Point(x + 1, t.Mean, canvasDraw),
|
|
2681
2682
|
new Point(x + 1, grandMean, new CanvasDrawSettings("#000", "#000", 0, 0, 0))
|
|
2682
2683
|
], t.treatment, void 0, new Line("straight", new CanvasDrawSettings("#000", "#000", 1)));
|
|
2684
|
+
chartSettings.axis.x.customGridlines.push(new CustomGridline(x + 1, t.treatment, void 0, void 0, void 0, void 0, true));
|
|
2683
2685
|
dataSets.push(newDataSet);
|
|
2684
2686
|
});
|
|
2685
|
-
|
|
2687
|
+
chartSettings.axis.x.showAutoGridlines = false;
|
|
2686
2688
|
chartSettings.axis.y.customGridlines = [new CustomGridline(grandMean, `x\u0305\u0305=${Math.round(grandMean * 1e3) / 1e3}`, new CanvasDrawSettings(GetThemeColor(2), GetThemeColor(2)), void 0, true), new CustomGridline(LDL, `LDL=${Math.round(LDL * 1e3) / 1e3}`, new CanvasDrawSettings("#F00", "#F00"), void 0, true, void 0, true), new CustomGridline(UDL, `UDL=${Math.round(UDL * 1e3) / 1e3}`, new CanvasDrawSettings("#F00", "#F00"), void 0, true, void 0, true)];
|
|
2687
2689
|
let chart = CreateScatterPlot(dataSets, name ? `Analysis of Means for ${name}` : "Analysis of Means", chartSettings);
|
|
2688
2690
|
return {
|
|
@@ -2760,8 +2762,8 @@ var ANOVA = {
|
|
|
2760
2762
|
mean,
|
|
2761
2763
|
stdev: StDev.S(data[key]),
|
|
2762
2764
|
SE: standardError,
|
|
2763
|
-
CI_Low: mean - tInv * standardError,
|
|
2764
|
-
CI_High: mean + tInv * standardError
|
|
2765
|
+
CI_Low: mean - Math.abs(tInv * standardError),
|
|
2766
|
+
CI_High: mean + Math.abs(tInv * standardError)
|
|
2765
2767
|
};
|
|
2766
2768
|
summaryTable.ConfidenceIntervals.push(CI_table);
|
|
2767
2769
|
}
|
|
@@ -3584,6 +3586,44 @@ var ANOVA = {
|
|
|
3584
3586
|
p: Distributions.F.TwoTail(F, factor1.length - 1, factor2.length - 1)
|
|
3585
3587
|
};
|
|
3586
3588
|
}
|
|
3589
|
+
},
|
|
3590
|
+
Multifactor: {
|
|
3591
|
+
MainEffectsPlot(factors, response) {
|
|
3592
|
+
let responseName = Object.keys(response)[0];
|
|
3593
|
+
let factorKeys = Object.keys(factors);
|
|
3594
|
+
let individualCharts = [];
|
|
3595
|
+
factorKeys.forEach((k) => {
|
|
3596
|
+
let arr = factors[k];
|
|
3597
|
+
let uniqueLevels = arr.filter((value, index, array) => array.indexOf(value) === index);
|
|
3598
|
+
let dataSet = new DataSet([]);
|
|
3599
|
+
dataSet.line = new Line("straight");
|
|
3600
|
+
let chartSettings = new ChartSettings();
|
|
3601
|
+
chartSettings.axis.x.showAutoGridlines = false;
|
|
3602
|
+
chartSettings.axis.x.min = 0.5;
|
|
3603
|
+
chartSettings.axis.x.max = uniqueLevels.length + 0.5;
|
|
3604
|
+
chartSettings.axis.x.autoSize = false;
|
|
3605
|
+
uniqueLevels.forEach((level, levelI) => {
|
|
3606
|
+
let mean = 0;
|
|
3607
|
+
let N = 0;
|
|
3608
|
+
arr.forEach((v, i) => {
|
|
3609
|
+
if (v === level) {
|
|
3610
|
+
mean += response[responseName][i];
|
|
3611
|
+
N += 1;
|
|
3612
|
+
}
|
|
3613
|
+
});
|
|
3614
|
+
mean = mean / N;
|
|
3615
|
+
dataSet.values.push(new Point(levelI + 1, mean, new CanvasDrawSettings("#2183b2", "#000", void 0, void 0, 5)));
|
|
3616
|
+
chartSettings.axis.x.customGridlines.push(new CustomGridline(levelI + 1, level, void 0, void 0, void 0, true, false));
|
|
3617
|
+
});
|
|
3618
|
+
chartSettings.width += 1e3;
|
|
3619
|
+
individualCharts.push(new Chart([dataSet], "scatter", k, chartSettings));
|
|
3620
|
+
});
|
|
3621
|
+
let chartSet = new ChartSettings();
|
|
3622
|
+
chartSet.width += 1e3;
|
|
3623
|
+
chartSet.axis.y.tickOnly = true;
|
|
3624
|
+
let graph = CreateSplitGraph(individualCharts, `Main Effects Plot of ${Object.keys(response)[0]}`, chartSet);
|
|
3625
|
+
return graph;
|
|
3626
|
+
}
|
|
3587
3627
|
}
|
|
3588
3628
|
};
|
|
3589
3629
|
function SumSquaredDeviation(data, referenceValue) {
|
|
@@ -3759,7 +3799,7 @@ function AddAxisGridlines(ctx, chartSettings, axis) {
|
|
|
3759
3799
|
}
|
|
3760
3800
|
let x = ConvertToCanvasPt(unadjustedValue, chartSettings.axis.x.min, chartSettings.axis.x.max, chartSettings.width - chartSettings.margins.left - chartSettings.margins.right - (((_v = chartSettings.axis.x.padding) == null ? void 0 : _v.left) ? (_w = chartSettings.axis.x.padding) == null ? void 0 : _w.left : 0) - (((_x = chartSettings.axis.x.padding) == null ? void 0 : _x.right) ? (_y = chartSettings.axis.x.padding) == null ? void 0 : _y.right : 0), chartSettings.axis.x) + chartSettings.margins.left + (((_z = chartSettings.axis.x.padding) == null ? void 0 : _z.left) ? (_A = chartSettings.axis.x.padding) == null ? void 0 : _A.left : 0);
|
|
3761
3801
|
ctx.beginPath();
|
|
3762
|
-
ctx.moveTo(x, chartSettings.axis.x.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yT);
|
|
3802
|
+
ctx.moveTo(x, chartSettings.axis.x.tickOnly ? chartSettings.height - chartSettings.margins.bottom + 10 : yT);
|
|
3763
3803
|
ctx.lineTo(x, yB);
|
|
3764
3804
|
if (((_B = chartSettings.axis.x.labels) == null ? void 0 : _B.length) === void 0) {
|
|
3765
3805
|
chartSettings.axis.x.labels = [];
|
|
@@ -3781,9 +3821,9 @@ function AddAxisGridlines(ctx, chartSettings, axis) {
|
|
|
3781
3821
|
if (gridline.dashed) {
|
|
3782
3822
|
ctx.setLineDash([20, 15]);
|
|
3783
3823
|
}
|
|
3784
|
-
ctx.moveTo(x, gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yT);
|
|
3824
|
+
ctx.moveTo(x, gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom + 10 : yT);
|
|
3785
3825
|
ctx.lineTo(x, gridline.opposite && !gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yB);
|
|
3786
|
-
ctx.fillText(gridline.label || RoundTO(gridline.value, 3), x, gridline.opposite ? chartSettings.margins.top - 10 : chartSettings.height - chartSettings.margins.bottom +
|
|
3826
|
+
ctx.fillText(gridline.label || RoundTO(gridline.value, 3), x, gridline.opposite ? chartSettings.margins.top - 10 : chartSettings.height - chartSettings.margins.bottom + 32);
|
|
3787
3827
|
ctx.stroke();
|
|
3788
3828
|
ctx.setLineDash([]);
|
|
3789
3829
|
ctx.closePath();
|
|
@@ -4511,8 +4551,6 @@ function CreateSplitGraph(charts, title, chartSettings = new ChartSettings()) {
|
|
|
4511
4551
|
ctx.fillText(chart.title, chart.chartSettings.margins.left, chart.chartSettings.margins.top - 10);
|
|
4512
4552
|
ctx == null ? void 0 : ctx.closePath();
|
|
4513
4553
|
}
|
|
4514
|
-
chart.chartSettings.axis.x.min = NaN;
|
|
4515
|
-
chart.chartSettings.axis.x.max = NaN;
|
|
4516
4554
|
AutoAxis(chart.data, chart.chartSettings);
|
|
4517
4555
|
AddAxisGridlines(ctx, chart.chartSettings, "x");
|
|
4518
4556
|
PlotData(ctx, chart.data, chart.chartSettings);
|
|
@@ -5255,8 +5293,6 @@ function GRRRChart(data) {
|
|
|
5255
5293
|
gl.display.strokeColor = "rgb(230,230,230)";
|
|
5256
5294
|
setSettings.axis.x.customGridlines.push(gl);
|
|
5257
5295
|
}
|
|
5258
|
-
setSettings.axis.x.min = 1;
|
|
5259
|
-
setSettings.axis.x.min = Npart;
|
|
5260
5296
|
setSettings.axis.x.showAutoGridlines = false;
|
|
5261
5297
|
newDataSet.line.type = "straight";
|
|
5262
5298
|
newDataSet.line.display.strokeWidth = 2;
|
|
@@ -5340,8 +5376,6 @@ function GRRXbarChart(data) {
|
|
|
5340
5376
|
gl.display.strokeColor = "rgb(230,230,230)";
|
|
5341
5377
|
setSettings.axis.x.customGridlines.push(gl);
|
|
5342
5378
|
}
|
|
5343
|
-
setSettings.axis.x.min = 1;
|
|
5344
|
-
setSettings.axis.x.min = Npart;
|
|
5345
5379
|
setSettings.axis.x.showAutoGridlines = false;
|
|
5346
5380
|
newDataSet.line.type = "straight";
|
|
5347
5381
|
newDataSet.line.display.strokeWidth = 2;
|
package/index.ts
CHANGED
|
@@ -3018,17 +3018,18 @@ export const ANOVA = {
|
|
|
3018
3018
|
let UDL = grandMean + pooledSTD*hAlpha*scaleDF
|
|
3019
3019
|
let LDL = grandMean - pooledSTD*hAlpha*scaleDF
|
|
3020
3020
|
|
|
3021
|
+
let chartSettings = new ChartSettings();
|
|
3021
3022
|
returnArray.forEach((t,x) => {
|
|
3022
3023
|
let canvasDraw: CanvasDrawSettings = (t.Mean < UDL && t.Mean > LDL) ? new CanvasDrawSettings('#2183b2', '#2183b2', undefined, 0) : new CanvasDrawSettings('#F00', '#F00',undefined,1)
|
|
3023
3024
|
let newDataSet = new DataSet([
|
|
3024
3025
|
new Point(x+1, t.Mean, canvasDraw),
|
|
3025
3026
|
new Point(x+1, grandMean, new CanvasDrawSettings('#000', '#000', 0, 0, 0))
|
|
3026
3027
|
],t.treatment,undefined, new Line("straight",new CanvasDrawSettings('#000','#000',1)));
|
|
3027
|
-
|
|
3028
|
+
chartSettings.axis.x.customGridlines.push(new CustomGridline(x+1, t.treatment, undefined, undefined, undefined, undefined, true))
|
|
3028
3029
|
dataSets.push(newDataSet);
|
|
3029
3030
|
})
|
|
3030
3031
|
|
|
3031
|
-
|
|
3032
|
+
chartSettings.axis.x.showAutoGridlines = false;
|
|
3032
3033
|
chartSettings.axis.y.customGridlines = [new CustomGridline(grandMean, `x̅̅=${Math.round(grandMean*1000)/1000}`, new CanvasDrawSettings(GetThemeColor(2), GetThemeColor(2)),undefined, true),new CustomGridline(LDL, `LDL=${Math.round(LDL*1000)/1000}`, new CanvasDrawSettings('#F00', '#F00'),undefined,true,undefined,true), new CustomGridline(UDL, `UDL=${Math.round(UDL*1000)/1000}`, new CanvasDrawSettings('#F00', '#F00'),undefined,true,undefined,true)]
|
|
3033
3034
|
let chart = CreateScatterPlot(dataSets, name ? `Analysis of Means for ${name}` : "Analysis of Means", chartSettings);
|
|
3034
3035
|
|
|
@@ -3115,8 +3116,8 @@ export const ANOVA = {
|
|
|
3115
3116
|
mean: mean,
|
|
3116
3117
|
stdev: StDev.S(data[key]),
|
|
3117
3118
|
SE: standardError,
|
|
3118
|
-
CI_Low: mean - tInv*standardError,
|
|
3119
|
-
CI_High: mean + tInv*standardError
|
|
3119
|
+
CI_Low: mean - Math.abs(tInv*standardError),
|
|
3120
|
+
CI_High: mean + Math.abs(tInv*standardError)
|
|
3120
3121
|
}
|
|
3121
3122
|
summaryTable.ConfidenceIntervals.push(CI_table);
|
|
3122
3123
|
}
|
|
@@ -3977,6 +3978,49 @@ export const ANOVA = {
|
|
|
3977
3978
|
p: Distributions.F.TwoTail(F, factor1.length - 1, factor2.length - 1)
|
|
3978
3979
|
}
|
|
3979
3980
|
}
|
|
3981
|
+
},
|
|
3982
|
+
Multifactor: {
|
|
3983
|
+
MainEffectsPlot(factors: any, response: any){
|
|
3984
|
+
let responseName = Object.keys(response)[0]
|
|
3985
|
+
let factorKeys = Object.keys(factors)
|
|
3986
|
+
let individualCharts: Chart[] = [];
|
|
3987
|
+
factorKeys.forEach(k => {
|
|
3988
|
+
let arr = factors[k];
|
|
3989
|
+
let uniqueLevels = arr.filter((value, index, array) => array.indexOf(value) === index);
|
|
3990
|
+
|
|
3991
|
+
let dataSet = new DataSet([]);
|
|
3992
|
+
dataSet.line = new Line('straight')
|
|
3993
|
+
|
|
3994
|
+
let chartSettings = new ChartSettings();
|
|
3995
|
+
chartSettings.axis.x.showAutoGridlines = false
|
|
3996
|
+
chartSettings.axis.x.min = .5;
|
|
3997
|
+
chartSettings.axis.x.max = uniqueLevels.length + .5
|
|
3998
|
+
chartSettings.axis.x.autoSize = false
|
|
3999
|
+
|
|
4000
|
+
uniqueLevels.forEach((level, levelI) => {
|
|
4001
|
+
let mean = 0;
|
|
4002
|
+
let N = 0;
|
|
4003
|
+
arr.forEach((v,i) => {
|
|
4004
|
+
if(v === level){
|
|
4005
|
+
mean += response[responseName][i]
|
|
4006
|
+
N += 1
|
|
4007
|
+
}
|
|
4008
|
+
})
|
|
4009
|
+
mean = mean/N;
|
|
4010
|
+
dataSet.values.push(new Point(levelI+1, mean, new CanvasDrawSettings('#2183b2','#000',undefined,undefined,5)));
|
|
4011
|
+
chartSettings.axis.x.customGridlines.push(new CustomGridline(levelI + 1, level,undefined, undefined,undefined, true, false))
|
|
4012
|
+
})
|
|
4013
|
+
chartSettings.width += 1000
|
|
4014
|
+
|
|
4015
|
+
individualCharts.push(new Chart([dataSet], "scatter", k, chartSettings))
|
|
4016
|
+
})
|
|
4017
|
+
let chartSet = new ChartSettings()
|
|
4018
|
+
chartSet.width += 1000
|
|
4019
|
+
chartSet.axis.y.tickOnly = true
|
|
4020
|
+
let graph = CreateSplitGraph(individualCharts, `Main Effects Plot of ${Object.keys(response)[0]}`, chartSet)
|
|
4021
|
+
|
|
4022
|
+
return graph
|
|
4023
|
+
}
|
|
3980
4024
|
}
|
|
3981
4025
|
}
|
|
3982
4026
|
|
|
@@ -4209,7 +4253,7 @@ function AddAxisGridlines(ctx: any, chartSettings: ChartSettings, axis: string)
|
|
|
4209
4253
|
let x = ConvertToCanvasPt(unadjustedValue, chartSettings.axis.x.min, chartSettings.axis.x.max, chartSettings.width - chartSettings.margins.left - chartSettings.margins.right - (chartSettings.axis.x.padding?.left ? chartSettings.axis.x.padding?.left : 0) - (chartSettings.axis.x.padding?.right ? chartSettings.axis.x.padding?.right : 0), chartSettings.axis.x) + chartSettings.margins.left + (chartSettings.axis.x.padding?.left ? chartSettings.axis.x.padding?.left : 0);
|
|
4210
4254
|
|
|
4211
4255
|
ctx.beginPath();
|
|
4212
|
-
ctx.moveTo(x, chartSettings.axis.x.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yT);
|
|
4256
|
+
ctx.moveTo(x, chartSettings.axis.x.tickOnly ? chartSettings.height - chartSettings.margins.bottom + 10 : yT);
|
|
4213
4257
|
ctx.lineTo(x, yB);
|
|
4214
4258
|
if(chartSettings.axis.x.labels?.length === undefined){
|
|
4215
4259
|
chartSettings.axis.x.labels = []
|
|
@@ -4233,10 +4277,10 @@ function AddAxisGridlines(ctx: any, chartSettings: ChartSettings, axis: string)
|
|
|
4233
4277
|
|
|
4234
4278
|
ctx.beginPath();
|
|
4235
4279
|
if(gridline.dashed){ctx.setLineDash([20, 15])}
|
|
4236
|
-
ctx.moveTo(x, gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yT);
|
|
4280
|
+
ctx.moveTo(x, gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom + 10 : yT);
|
|
4237
4281
|
ctx.lineTo(x, gridline.opposite && !gridline.tickOnly ? chartSettings.height - chartSettings.margins.bottom : yB);
|
|
4238
4282
|
|
|
4239
|
-
ctx.fillText(gridline.label || RoundTO(gridline.value, 3), x, gridline.opposite ? chartSettings.margins.top - 10 : chartSettings.height - chartSettings.margins.bottom +
|
|
4283
|
+
ctx.fillText(gridline.label || RoundTO(gridline.value, 3), x, gridline.opposite ? chartSettings.margins.top - 10 : chartSettings.height - chartSettings.margins.bottom + 32);
|
|
4240
4284
|
ctx.stroke();
|
|
4241
4285
|
ctx.setLineDash([])
|
|
4242
4286
|
ctx.closePath();
|
|
@@ -5110,8 +5154,8 @@ export function CreateSplitGraph(charts: Chart[], title: string, chartSettings:
|
|
|
5110
5154
|
}
|
|
5111
5155
|
|
|
5112
5156
|
// Automate X-axis
|
|
5113
|
-
chart.chartSettings.axis.x.min = NaN;
|
|
5114
|
-
chart.chartSettings.axis.x.max = NaN;
|
|
5157
|
+
// chart.chartSettings.axis.x.min = NaN;
|
|
5158
|
+
// chart.chartSettings.axis.x.max = NaN;
|
|
5115
5159
|
AutoAxis(chart.data, chart.chartSettings);
|
|
5116
5160
|
AddAxisGridlines(ctx, chart.chartSettings, 'x');
|
|
5117
5161
|
|
|
@@ -6029,8 +6073,6 @@ function GRRRChart(data: GRRData){
|
|
|
6029
6073
|
gl.display.strokeColor = 'rgb(230,230,230)'
|
|
6030
6074
|
setSettings.axis.x.customGridlines.push(gl)
|
|
6031
6075
|
}
|
|
6032
|
-
setSettings.axis.x.min = 1
|
|
6033
|
-
setSettings.axis.x.min = Npart;
|
|
6034
6076
|
setSettings.axis.x.showAutoGridlines = false;
|
|
6035
6077
|
newDataSet.line.type = 'straight';
|
|
6036
6078
|
newDataSet.line.display.strokeWidth = 2;
|
|
@@ -6123,8 +6165,6 @@ function GRRXbarChart(data: GRRData){
|
|
|
6123
6165
|
gl.display.strokeColor = 'rgb(230,230,230)'
|
|
6124
6166
|
setSettings.axis.x.customGridlines.push(gl)
|
|
6125
6167
|
}
|
|
6126
|
-
setSettings.axis.x.min = 1
|
|
6127
|
-
setSettings.axis.x.min = Npart;
|
|
6128
6168
|
setSettings.axis.x.showAutoGridlines = false;
|
|
6129
6169
|
newDataSet.line.type = 'straight';
|
|
6130
6170
|
newDataSet.line.display.strokeWidth = 2;
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Added Features:
|
|
2
|
+
- ANOVA
|
|
3
|
+
- Multifactor
|
|
4
|
+
- MainEffectsPlot
|
|
5
|
+
|
|
6
|
+
Modified Features
|
|
7
|
+
- Split graph
|
|
8
|
+
- removed lines that set x.min and x.max to NaN to fix custom gridline bug
|
|
9
|
+
- GRRRChart & GGRXBarChart
|
|
10
|
+
- removed lines of code that set x.min and x.max to fix NaN custom gridlining bug (see previous note^)
|
|
11
|
+
- AnalysisOfMeans.OneWay() Chart
|
|
12
|
+
- changed x-axis to match categorical treatment groupings
|
|
13
|
+
- ANOVA.OneWay.Table
|
|
14
|
+
- fixed CI_Low/CI_High flipped bug in Confidence Intervals by using absolute value of Tcrit
|