qesuite 1.0.59 → 1.0.61

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 CHANGED
@@ -185,6 +185,7 @@ declare class GRRReplication {
185
185
  getPartIndices(): any;
186
186
  }
187
187
  declare function ObjectToArray(object: any): any[];
188
+ declare function RoundDigits(number: any, digits?: number, omitTrailingZeros?: boolean): any;
188
189
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189
190
  */
190
191
  declare const Capability: {
@@ -1247,8 +1248,8 @@ declare const Correlation: {
1247
1248
  };
1248
1249
  declare function Count(arr: any[], value: any): number;
1249
1250
  declare function DescriptiveStatistics(data: number[]): {
1250
- Mean: number;
1251
1251
  N: number;
1252
+ Mean: number;
1252
1253
  StDev: number;
1253
1254
  SE: number;
1254
1255
  };
@@ -1348,8 +1349,8 @@ declare const EquivalenceTesting: {
1348
1349
  Summary: HTMLCanvasElement;
1349
1350
  };
1350
1351
  DescriptiveStatistics: {
1351
- Mean: number;
1352
1352
  N: number;
1353
+ Mean: number;
1353
1354
  StDev: number;
1354
1355
  SE: number;
1355
1356
  };
@@ -1386,8 +1387,8 @@ declare const EquivalenceTesting: {
1386
1387
  Summary: HTMLCanvasElement;
1387
1388
  };
1388
1389
  DescriptiveStatistics: {
1389
- Mean: number;
1390
1390
  N: number;
1391
+ Mean: number;
1391
1392
  StDev: number;
1392
1393
  SE: number;
1393
1394
  Variable: any;
@@ -1426,8 +1427,8 @@ declare const EquivalenceTesting: {
1426
1427
  Summary: HTMLCanvasElement;
1427
1428
  };
1428
1429
  DescriptiveStatistics: {
1429
- Mean: number;
1430
1430
  N: number;
1431
+ Mean: number;
1431
1432
  StDev: number;
1432
1433
  SE: number;
1433
1434
  Variable: any;
@@ -1516,8 +1517,9 @@ declare const NonparametricTesting: {
1516
1517
  p: number;
1517
1518
  };
1518
1519
  };
1519
- KruskallWallis(data: number[][]): {
1520
+ KruskalWallis(data: any[][]): {
1520
1521
  DescriptiveStatistics: {
1522
+ Sample: any;
1521
1523
  N: number;
1522
1524
  Median: any;
1523
1525
  MeanRank: any;
@@ -1933,7 +1935,7 @@ declare function MultipleLinearRegression(dependent: number[], factors: any, int
1933
1935
  SS: number;
1934
1936
  };
1935
1937
  };
1936
- Coeffecients: {};
1938
+ Coefficients: {};
1937
1939
  S: number;
1938
1940
  AdjRSq: number;
1939
1941
  RSq: number;
@@ -2292,4 +2294,4 @@ declare function GRRPartxOperatorChart(data: GRRData): HTMLCanvasElement;
2292
2294
  declare function CompileGRRObject(operators: any, parts: any, measurements: any): GRRData;
2293
2295
  declare function Unique(values: any[]): any[];
2294
2296
 
2295
- export { ANOMEChartEMP, ANOMRChartEMP, ANOVA, AnovaTableTwoWay, AttributeAgreementAnalysis, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CohenKappa, CompileGRRObject, Correlation, Count, CreateBarChart, CreateBoxPlot, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateControlChart, CreateLayeredChart, CreateMatrixChart, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomDraw, CustomGridline, CustomGridlines, DataCollection, DataSet, DescriptiveStatistics, Distributions, ERF, EngFont, EquivalenceTesting, EvaluateMeasurementProcess, FixedPointIteration, FleissKappa, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, GageLinearityAndBias, Gamma, GeneralizedLinearModel, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, HypothesisTesting, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, MANOVA, Margin, MaximumLikelihoodParameters, Mean, Median, MedianMovingRange, MovingRange, MovingRangeChart, MultipleLinearRegression, NestedGRR, NestedGRRByPartChart, NewtonRaphson, NonlinearRootFinding, NonparametricTesting, ObjectToArray, OutlierTesting, ParameterizedCDF, PlochhammerSymbol, Point, Probability, Product, QQPlot, QQPlotChart, Quartile, Rang, SerializeData, SimpleLinearRegression, Specification, StDev, StandardError, Sum, SumSq, SumSquaredDeviation, TrimmedMean, UnbiasingConstant, Unique, Variance, VarianceComponents };
2297
+ export { ANOMEChartEMP, ANOMRChartEMP, ANOVA, AnovaTableTwoWay, AttributeAgreementAnalysis, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CohenKappa, CompileGRRObject, Correlation, Count, CreateBarChart, CreateBoxPlot, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateControlChart, CreateLayeredChart, CreateMatrixChart, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomDraw, CustomGridline, CustomGridlines, DataCollection, DataSet, DescriptiveStatistics, Distributions, ERF, EngFont, EquivalenceTesting, EvaluateMeasurementProcess, FixedPointIteration, FleissKappa, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, GageLinearityAndBias, Gamma, GeneralizedLinearModel, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, HypothesisTesting, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, MANOVA, Margin, MaximumLikelihoodParameters, Mean, Median, MedianMovingRange, MovingRange, MovingRangeChart, MultipleLinearRegression, NestedGRR, NestedGRRByPartChart, NewtonRaphson, NonlinearRootFinding, NonparametricTesting, ObjectToArray, OutlierTesting, ParameterizedCDF, PlochhammerSymbol, Point, Probability, Product, QQPlot, QQPlotChart, Quartile, Rang, RoundDigits, SerializeData, SimpleLinearRegression, Specification, StDev, StandardError, Sum, SumSq, SumSquaredDeviation, TrimmedMean, UnbiasingConstant, Unique, Variance, VarianceComponents };
package/dist/index.d.ts CHANGED
@@ -185,6 +185,7 @@ declare class GRRReplication {
185
185
  getPartIndices(): any;
186
186
  }
187
187
  declare function ObjectToArray(object: any): any[];
188
+ declare function RoundDigits(number: any, digits?: number, omitTrailingZeros?: boolean): any;
188
189
  /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189
190
  */
190
191
  declare const Capability: {
@@ -1247,8 +1248,8 @@ declare const Correlation: {
1247
1248
  };
1248
1249
  declare function Count(arr: any[], value: any): number;
1249
1250
  declare function DescriptiveStatistics(data: number[]): {
1250
- Mean: number;
1251
1251
  N: number;
1252
+ Mean: number;
1252
1253
  StDev: number;
1253
1254
  SE: number;
1254
1255
  };
@@ -1348,8 +1349,8 @@ declare const EquivalenceTesting: {
1348
1349
  Summary: HTMLCanvasElement;
1349
1350
  };
1350
1351
  DescriptiveStatistics: {
1351
- Mean: number;
1352
1352
  N: number;
1353
+ Mean: number;
1353
1354
  StDev: number;
1354
1355
  SE: number;
1355
1356
  };
@@ -1386,8 +1387,8 @@ declare const EquivalenceTesting: {
1386
1387
  Summary: HTMLCanvasElement;
1387
1388
  };
1388
1389
  DescriptiveStatistics: {
1389
- Mean: number;
1390
1390
  N: number;
1391
+ Mean: number;
1391
1392
  StDev: number;
1392
1393
  SE: number;
1393
1394
  Variable: any;
@@ -1426,8 +1427,8 @@ declare const EquivalenceTesting: {
1426
1427
  Summary: HTMLCanvasElement;
1427
1428
  };
1428
1429
  DescriptiveStatistics: {
1429
- Mean: number;
1430
1430
  N: number;
1431
+ Mean: number;
1431
1432
  StDev: number;
1432
1433
  SE: number;
1433
1434
  Variable: any;
@@ -1516,8 +1517,9 @@ declare const NonparametricTesting: {
1516
1517
  p: number;
1517
1518
  };
1518
1519
  };
1519
- KruskallWallis(data: number[][]): {
1520
+ KruskalWallis(data: any[][]): {
1520
1521
  DescriptiveStatistics: {
1522
+ Sample: any;
1521
1523
  N: number;
1522
1524
  Median: any;
1523
1525
  MeanRank: any;
@@ -1933,7 +1935,7 @@ declare function MultipleLinearRegression(dependent: number[], factors: any, int
1933
1935
  SS: number;
1934
1936
  };
1935
1937
  };
1936
- Coeffecients: {};
1938
+ Coefficients: {};
1937
1939
  S: number;
1938
1940
  AdjRSq: number;
1939
1941
  RSq: number;
@@ -2292,4 +2294,4 @@ declare function GRRPartxOperatorChart(data: GRRData): HTMLCanvasElement;
2292
2294
  declare function CompileGRRObject(operators: any, parts: any, measurements: any): GRRData;
2293
2295
  declare function Unique(values: any[]): any[];
2294
2296
 
2295
- export { ANOMEChartEMP, ANOMRChartEMP, ANOVA, AnovaTableTwoWay, AttributeAgreementAnalysis, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CohenKappa, CompileGRRObject, Correlation, Count, CreateBarChart, CreateBoxPlot, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateControlChart, CreateLayeredChart, CreateMatrixChart, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomDraw, CustomGridline, CustomGridlines, DataCollection, DataSet, DescriptiveStatistics, Distributions, ERF, EngFont, EquivalenceTesting, EvaluateMeasurementProcess, FixedPointIteration, FleissKappa, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, GageLinearityAndBias, Gamma, GeneralizedLinearModel, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, HypothesisTesting, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, MANOVA, Margin, MaximumLikelihoodParameters, Mean, Median, MedianMovingRange, MovingRange, MovingRangeChart, MultipleLinearRegression, NestedGRR, NestedGRRByPartChart, NewtonRaphson, NonlinearRootFinding, NonparametricTesting, ObjectToArray, OutlierTesting, ParameterizedCDF, PlochhammerSymbol, Point, Probability, Product, QQPlot, QQPlotChart, Quartile, Rang, SerializeData, SimpleLinearRegression, Specification, StDev, StandardError, Sum, SumSq, SumSquaredDeviation, TrimmedMean, UnbiasingConstant, Unique, Variance, VarianceComponents };
2297
+ export { ANOMEChartEMP, ANOMRChartEMP, ANOVA, AnovaTableTwoWay, AttributeAgreementAnalysis, AverageMovingRange, AxisSettings, Beta, CanvasDrawSettings, Capability, Chart, ChartSettings, CohenKappa, CompileGRRObject, Correlation, Count, CreateBarChart, CreateBoxPlot, CreateBoxandWhiskerGraph, CreateCapabilityHistogram, CreateCapabilityPlot, CreateCategoricalBarGraph, CreateContinuousBarGraph, CreateControlChart, CreateLayeredChart, CreateMatrixChart, CreateScatterPlot, CreateSplitGraph, CreateStackedChart, CreateSummaryChart, CustomDraw, CustomGridline, CustomGridlines, DataCollection, DataSet, DescriptiveStatistics, Distributions, ERF, EngFont, EquivalenceTesting, EvaluateMeasurementProcess, FixedPointIteration, FleissKappa, G1, G1Graphs, GRR, GRRByPartChart, GRRData, GRRGraphs, GRROperator, GRRPartxOperatorChart, GRRReplication, GageEvaluation, GageLinearityAndBias, Gamma, GeneralizedLinearModel, GetFunctionValues, GetHistogramDataset, GoodnessOfFit, HypothesisTesting, IndividualDistributionIdentification, IndividualDistributionPlots, IndividualValuePlot, LastObservationsChart, Line, MANOVA, Margin, MaximumLikelihoodParameters, Mean, Median, MedianMovingRange, MovingRange, MovingRangeChart, MultipleLinearRegression, NestedGRR, NestedGRRByPartChart, NewtonRaphson, NonlinearRootFinding, NonparametricTesting, ObjectToArray, OutlierTesting, ParameterizedCDF, PlochhammerSymbol, Point, Probability, Product, QQPlot, QQPlotChart, Quartile, Rang, RoundDigits, SerializeData, SimpleLinearRegression, Specification, StDev, StandardError, Sum, SumSq, SumSquaredDeviation, TrimmedMean, UnbiasingConstant, Unique, Variance, VarianceComponents };
package/dist/index.js CHANGED
@@ -109,6 +109,7 @@ __export(QESuite_exports, {
109
109
  QQPlotChart: () => QQPlotChart,
110
110
  Quartile: () => Quartile,
111
111
  Rang: () => Rang,
112
+ RoundDigits: () => RoundDigits,
112
113
  SerializeData: () => SerializeData,
113
114
  SimpleLinearRegression: () => SimpleLinearRegression,
114
115
  Specification: () => Specification,
@@ -4353,7 +4354,7 @@ var Distributions = {
4353
4354
  } else {
4354
4355
  min = AbsLSL;
4355
4356
  }
4356
- return min / (10 * standard_deviation);
4357
+ return min / standard_deviation;
4357
4358
  },
4358
4359
  JarqueBera(data) {
4359
4360
  let N = data.length;
@@ -4893,9 +4894,10 @@ var Distributions = {
4893
4894
  };
4894
4895
  let t = void 0;
4895
4896
  try {
4896
- t = table[`${p}`][df - 1];
4897
4897
  if (p < 0.5) {
4898
- t = -t;
4898
+ t = -1 * table[`${1 - p}`][df - 1];
4899
+ } else {
4900
+ t = table[`${p}`][df - 1];
4899
4901
  }
4900
4902
  return t;
4901
4903
  } catch (err) {
@@ -6671,7 +6673,6 @@ var MANOVA = {
6671
6673
  return factors[inter][i];
6672
6674
  }).join("*"));
6673
6675
  }
6674
- console.log(factor);
6675
6676
  let q = Unique(factor).length - 1;
6676
6677
  let E = MANOVA.ErrorMatrix(responses, factor);
6677
6678
  let H = MANOVA.HypothesisMatrix(responses, factor);
@@ -6741,10 +6742,8 @@ var MANOVA = {
6741
6742
  let factorSSCP = Matrix.Multiply(Matrix.Transpose(rDevMatrix), rDevMatrix);
6742
6743
  ErrorMatrix = Matrix.Sum(ErrorMatrix, factorSSCP);
6743
6744
  });
6744
- console.log({ DeviationMatrix, nMatrix });
6745
6745
  let devXn = Matrix.Scale(DeviationMatrix, nMatrix);
6746
6746
  let HypothesisMatrix = Matrix.Multiply(Matrix.Transpose(DeviationMatrix), devXn);
6747
- console.log({ HypothesisMatrix, ErrorMatrix });
6748
6747
  let EStarStar_1_xH = Matrix.Multiply(Matrix.Inverse(ErrorMatrix), HypothesisMatrix);
6749
6748
  let EigenValues = Matrix.EigenValues(EStarStar_1_xH);
6750
6749
  let eigenWilk = Product(EigenValues.map((l) => {
@@ -7151,8 +7150,8 @@ function Combinatrix(values) {
7151
7150
  }
7152
7151
  function DescriptiveStatistics(data) {
7153
7152
  return {
7154
- Mean: Mean(data),
7155
7153
  N: data.length,
7154
+ Mean: Mean(data),
7156
7155
  StDev: StDev.S(data),
7157
7156
  SE: StandardError(data)
7158
7157
  };
@@ -7830,10 +7829,11 @@ var NonparametricTesting = {
7830
7829
  }
7831
7830
  };
7832
7831
  },
7833
- KruskallWallis(data) {
7832
+ KruskalWallis(data) {
7834
7833
  let combinedData = [];
7835
7834
  data.forEach((g) => {
7836
- combinedData.push(...g);
7835
+ let { name: groupName, data: groupData } = FormatInputData(g);
7836
+ combinedData.push(...groupData);
7837
7837
  });
7838
7838
  let ranks = Rank.Combined(data);
7839
7839
  let avgRanks = ranks.map((r) => {
@@ -7862,6 +7862,7 @@ var NonparametricTesting = {
7862
7862
  return {
7863
7863
  DescriptiveStatistics: data.map((group, i) => {
7864
7864
  return {
7865
+ Sample: FormatInputData(group).name ?? `Group ${i + 1}`,
7865
7866
  N: group.length,
7866
7867
  Median: Median(group),
7867
7868
  MeanRank: avgRanks[i],
@@ -10591,11 +10592,11 @@ function GeneralizedLinearModel(dependent, factors, covariates = {}, interaction
10591
10592
  p: Distributions.F.RightTail(F_this, DF_this, regressionModel.ANOVA.Residual.DF)
10592
10593
  });
10593
10594
  });
10594
- ANOVA2.push({ Source: "Error", ...regressionModel.ANOVA.Residual });
10595
- ANOVA2.push({ Source: "Total", ...regressionModel.ANOVA.Total });
10595
+ ANOVA2.push({ Source: "Error", DF: regressionModel.ANOVA.Residual.DF, AdjSS: regressionModel.ANOVA.Residual.SS, AdjMS: regressionModel.ANOVA.Residual.MS });
10596
+ ANOVA2.push({ Source: "Total", DF: regressionModel.ANOVA.Total.DF, AdjSS: regressionModel.ANOVA.Total.SS });
10596
10597
  return {
10597
10598
  ANOVA: ANOVA2,
10598
- Coefficients: regressionModel.Coeffecients,
10599
+ Coefficients: regressionModel.Coefficients,
10599
10600
  ModelSummary: {
10600
10601
  AdjRSq: regressionModel.AdjRSq,
10601
10602
  MultipleR: Math.sqrt(regressionModel.RSq),
@@ -10654,11 +10655,11 @@ function MultipleLinearRegression(dependent, factors, interactions = true) {
10654
10655
  let inv_xTx = Matrix.Inverse(Matrix.Multiply(Matrix.Transpose(x), x));
10655
10656
  let xTy = Matrix.Multiply(Matrix.Transpose(x), y);
10656
10657
  let betaEstimators = Matrix.Multiply(inv_xTx, xTy);
10657
- let coeffecients = {};
10658
+ let coefficients = {};
10658
10659
  for (let i = 0; i < betaEstimators.length; i++) {
10659
10660
  let fName = fKeys[i];
10660
- coeffecients[fName] = {
10661
- Coeffecient: betaEstimators[i][0]
10661
+ coefficients[fName] = {
10662
+ Coefficient: betaEstimators[i][0]
10662
10663
  };
10663
10664
  }
10664
10665
  let DFT = N - 1;
@@ -10700,7 +10701,7 @@ function MultipleLinearRegression(dependent, factors, interactions = true) {
10700
10701
  SS: SST
10701
10702
  }
10702
10703
  },
10703
- Coeffecients: coeffecients,
10704
+ Coefficients: coefficients,
10704
10705
  S,
10705
10706
  AdjRSq,
10706
10707
  RSq,
@@ -11456,7 +11457,6 @@ function ANOMEChartEMP(operators, parts, responses, title, confidenceLevel = 0.0
11456
11457
  let g = Unique(parts).length * byTreatments.length;
11457
11458
  let m = rData.length / g;
11458
11459
  let d2 = UnbiasingConstant.D2prime(g, m);
11459
- console.log(d2);
11460
11460
  let A\u03B1 = t\u03B1_2 / d2 * Math.sqrt(1 / n);
11461
11461
  let LDL = XbarBar - A\u03B1 * Rbar;
11462
11462
  let UDL = XbarBar + A\u03B1 * Rbar;
@@ -11502,7 +11502,6 @@ function ANOMRChartEMP(operators, parts, responses, title, confidenceLevel = 0.0
11502
11502
  byTreatments.forEach((t, ti) => {
11503
11503
  let { name: tName, data: tData } = FormatInputData(t);
11504
11504
  let rng = Mean(tData);
11505
- console.log({ rng, tData });
11506
11505
  dataset.values.push(new Point(ti, rng));
11507
11506
  chartSettings.axis.x.customGridlines.push(new CustomGridline(ti, tName));
11508
11507
  });
@@ -11809,7 +11808,6 @@ function GageLinearityAndBias(parts, referenceValues, responses, processVariatio
11809
11808
  let \u03C3 = (Math.max(...biases) - Math.min(...biases)) / d2;
11810
11809
  t = bias / (\u03C3 / Math.sqrt(n2));
11811
11810
  }
11812
- console.log(t, df);
11813
11811
  let pValue = Distributions.T.cdf(-Math.abs(t), df) + Distributions.T.RightTail(Math.abs(t), df);
11814
11812
  partBiases.push({
11815
11813
  ReferenceValue: ref,
@@ -12839,6 +12837,7 @@ var Matrix = {
12839
12837
  QQPlotChart,
12840
12838
  Quartile,
12841
12839
  Rang,
12840
+ RoundDigits,
12842
12841
  SerializeData,
12843
12842
  SimpleLinearRegression,
12844
12843
  Specification,
package/dist/index.mjs CHANGED
@@ -4228,7 +4228,7 @@ var Distributions = {
4228
4228
  } else {
4229
4229
  min = AbsLSL;
4230
4230
  }
4231
- return min / (10 * standard_deviation);
4231
+ return min / standard_deviation;
4232
4232
  },
4233
4233
  JarqueBera(data) {
4234
4234
  let N = data.length;
@@ -4768,9 +4768,10 @@ var Distributions = {
4768
4768
  };
4769
4769
  let t = void 0;
4770
4770
  try {
4771
- t = table[`${p}`][df - 1];
4772
4771
  if (p < 0.5) {
4773
- t = -t;
4772
+ t = -1 * table[`${1 - p}`][df - 1];
4773
+ } else {
4774
+ t = table[`${p}`][df - 1];
4774
4775
  }
4775
4776
  return t;
4776
4777
  } catch (err) {
@@ -6546,7 +6547,6 @@ var MANOVA = {
6546
6547
  return factors[inter][i];
6547
6548
  }).join("*"));
6548
6549
  }
6549
- console.log(factor);
6550
6550
  let q = Unique(factor).length - 1;
6551
6551
  let E = MANOVA.ErrorMatrix(responses, factor);
6552
6552
  let H = MANOVA.HypothesisMatrix(responses, factor);
@@ -6616,10 +6616,8 @@ var MANOVA = {
6616
6616
  let factorSSCP = Matrix.Multiply(Matrix.Transpose(rDevMatrix), rDevMatrix);
6617
6617
  ErrorMatrix = Matrix.Sum(ErrorMatrix, factorSSCP);
6618
6618
  });
6619
- console.log({ DeviationMatrix, nMatrix });
6620
6619
  let devXn = Matrix.Scale(DeviationMatrix, nMatrix);
6621
6620
  let HypothesisMatrix = Matrix.Multiply(Matrix.Transpose(DeviationMatrix), devXn);
6622
- console.log({ HypothesisMatrix, ErrorMatrix });
6623
6621
  let EStarStar_1_xH = Matrix.Multiply(Matrix.Inverse(ErrorMatrix), HypothesisMatrix);
6624
6622
  let EigenValues = Matrix.EigenValues(EStarStar_1_xH);
6625
6623
  let eigenWilk = Product(EigenValues.map((l) => {
@@ -7026,8 +7024,8 @@ function Combinatrix(values) {
7026
7024
  }
7027
7025
  function DescriptiveStatistics(data) {
7028
7026
  return {
7029
- Mean: Mean(data),
7030
7027
  N: data.length,
7028
+ Mean: Mean(data),
7031
7029
  StDev: StDev.S(data),
7032
7030
  SE: StandardError(data)
7033
7031
  };
@@ -7705,10 +7703,11 @@ var NonparametricTesting = {
7705
7703
  }
7706
7704
  };
7707
7705
  },
7708
- KruskallWallis(data) {
7706
+ KruskalWallis(data) {
7709
7707
  let combinedData = [];
7710
7708
  data.forEach((g) => {
7711
- combinedData.push(...g);
7709
+ let { name: groupName, data: groupData } = FormatInputData(g);
7710
+ combinedData.push(...groupData);
7712
7711
  });
7713
7712
  let ranks = Rank.Combined(data);
7714
7713
  let avgRanks = ranks.map((r) => {
@@ -7737,6 +7736,7 @@ var NonparametricTesting = {
7737
7736
  return {
7738
7737
  DescriptiveStatistics: data.map((group, i) => {
7739
7738
  return {
7739
+ Sample: FormatInputData(group).name ?? `Group ${i + 1}`,
7740
7740
  N: group.length,
7741
7741
  Median: Median(group),
7742
7742
  MeanRank: avgRanks[i],
@@ -10466,11 +10466,11 @@ function GeneralizedLinearModel(dependent, factors, covariates = {}, interaction
10466
10466
  p: Distributions.F.RightTail(F_this, DF_this, regressionModel.ANOVA.Residual.DF)
10467
10467
  });
10468
10468
  });
10469
- ANOVA2.push({ Source: "Error", ...regressionModel.ANOVA.Residual });
10470
- ANOVA2.push({ Source: "Total", ...regressionModel.ANOVA.Total });
10469
+ ANOVA2.push({ Source: "Error", DF: regressionModel.ANOVA.Residual.DF, AdjSS: regressionModel.ANOVA.Residual.SS, AdjMS: regressionModel.ANOVA.Residual.MS });
10470
+ ANOVA2.push({ Source: "Total", DF: regressionModel.ANOVA.Total.DF, AdjSS: regressionModel.ANOVA.Total.SS });
10471
10471
  return {
10472
10472
  ANOVA: ANOVA2,
10473
- Coefficients: regressionModel.Coeffecients,
10473
+ Coefficients: regressionModel.Coefficients,
10474
10474
  ModelSummary: {
10475
10475
  AdjRSq: regressionModel.AdjRSq,
10476
10476
  MultipleR: Math.sqrt(regressionModel.RSq),
@@ -10529,11 +10529,11 @@ function MultipleLinearRegression(dependent, factors, interactions = true) {
10529
10529
  let inv_xTx = Matrix.Inverse(Matrix.Multiply(Matrix.Transpose(x), x));
10530
10530
  let xTy = Matrix.Multiply(Matrix.Transpose(x), y);
10531
10531
  let betaEstimators = Matrix.Multiply(inv_xTx, xTy);
10532
- let coeffecients = {};
10532
+ let coefficients = {};
10533
10533
  for (let i = 0; i < betaEstimators.length; i++) {
10534
10534
  let fName = fKeys[i];
10535
- coeffecients[fName] = {
10536
- Coeffecient: betaEstimators[i][0]
10535
+ coefficients[fName] = {
10536
+ Coefficient: betaEstimators[i][0]
10537
10537
  };
10538
10538
  }
10539
10539
  let DFT = N - 1;
@@ -10575,7 +10575,7 @@ function MultipleLinearRegression(dependent, factors, interactions = true) {
10575
10575
  SS: SST
10576
10576
  }
10577
10577
  },
10578
- Coeffecients: coeffecients,
10578
+ Coefficients: coefficients,
10579
10579
  S,
10580
10580
  AdjRSq,
10581
10581
  RSq,
@@ -11331,7 +11331,6 @@ function ANOMEChartEMP(operators, parts, responses, title, confidenceLevel = 0.0
11331
11331
  let g = Unique(parts).length * byTreatments.length;
11332
11332
  let m = rData.length / g;
11333
11333
  let d2 = UnbiasingConstant.D2prime(g, m);
11334
- console.log(d2);
11335
11334
  let A\u03B1 = t\u03B1_2 / d2 * Math.sqrt(1 / n);
11336
11335
  let LDL = XbarBar - A\u03B1 * Rbar;
11337
11336
  let UDL = XbarBar + A\u03B1 * Rbar;
@@ -11377,7 +11376,6 @@ function ANOMRChartEMP(operators, parts, responses, title, confidenceLevel = 0.0
11377
11376
  byTreatments.forEach((t, ti) => {
11378
11377
  let { name: tName, data: tData } = FormatInputData(t);
11379
11378
  let rng = Mean(tData);
11380
- console.log({ rng, tData });
11381
11379
  dataset.values.push(new Point(ti, rng));
11382
11380
  chartSettings.axis.x.customGridlines.push(new CustomGridline(ti, tName));
11383
11381
  });
@@ -11684,7 +11682,6 @@ function GageLinearityAndBias(parts, referenceValues, responses, processVariatio
11684
11682
  let \u03C3 = (Math.max(...biases) - Math.min(...biases)) / d2;
11685
11683
  t = bias / (\u03C3 / Math.sqrt(n2));
11686
11684
  }
11687
- console.log(t, df);
11688
11685
  let pValue = Distributions.T.cdf(-Math.abs(t), df) + Distributions.T.RightTail(Math.abs(t), df);
11689
11686
  partBiases.push({
11690
11687
  ReferenceValue: ref,
@@ -12713,6 +12710,7 @@ export {
12713
12710
  QQPlotChart,
12714
12711
  Quartile,
12715
12712
  Rang,
12713
+ RoundDigits,
12716
12714
  SerializeData,
12717
12715
  SimpleLinearRegression,
12718
12716
  Specification,
package/index.ts CHANGED
@@ -624,7 +624,7 @@ function RoundTO(number: number, digits: number){
624
624
  }
625
625
 
626
626
  // Adds Trailing Zeros
627
- function RoundDigits(number: any, digits: number = 2, omitTrailingZeros?: boolean){
627
+ export function RoundDigits(number: any, digits: number = 2, omitTrailingZeros?: boolean){
628
628
  if(digits == 0){digits = -1}
629
629
  if(isNaN(number) || number == Infinity){
630
630
  return number
@@ -4482,7 +4482,7 @@ export const Distributions = {
4482
4482
  }else{
4483
4483
  min = AbsLSL;
4484
4484
  }
4485
- return min/(10*standard_deviation);
4485
+ return min/(standard_deviation);
4486
4486
  },
4487
4487
  JarqueBera(data: number[]){
4488
4488
  let N = data.length;
@@ -5041,9 +5041,10 @@ export const Distributions = {
5041
5041
  }
5042
5042
  let t: any = undefined
5043
5043
  try {
5044
- t = table[`${p}`][df-1]
5045
5044
  if(p < 0.5){
5046
- t = -t
5045
+ t = -1 * table[`${1 - p}`][df-1]
5046
+ }else{
5047
+ t = table[`${p}`][df-1]
5047
5048
  }
5048
5049
  return t
5049
5050
  }catch (err){
@@ -5770,7 +5771,7 @@ export const ANOVA = {
5770
5771
  let this_n = data[key].length;
5771
5772
  let standardError = summaryTable.ANOVA.Error.AdjMS/this_n;
5772
5773
  let tInv = Distributions.T.inv(0.05, summaryTable.ANOVA.Error.DF);
5773
-
5774
+
5774
5775
  let CI_table = {
5775
5776
  name: key,
5776
5777
  N: this_n,
@@ -7015,7 +7016,6 @@ export const MANOVA = {
7015
7016
  for(let i = 0; i < responses[rKeys[0]].length; i++){
7016
7017
  factor.push(int.map(inter => {return factors[inter][i]}).join("*"))
7017
7018
  }
7018
- console.log(factor);
7019
7019
 
7020
7020
  let q = Unique(factor).length - 1;
7021
7021
  let E = MANOVA.ErrorMatrix(responses, factor);
@@ -7093,10 +7093,9 @@ export const MANOVA = {
7093
7093
  ErrorMatrix = Matrix.Sum(ErrorMatrix, factorSSCP);
7094
7094
  })
7095
7095
 
7096
- console.log({DeviationMatrix, nMatrix})
7097
7096
  let devXn = Matrix.Scale(DeviationMatrix, nMatrix);
7098
7097
  let HypothesisMatrix = Matrix.Multiply(Matrix.Transpose(DeviationMatrix), devXn)//, responses[rKeys[0]].length/factorGroups.length)
7099
- console.log({HypothesisMatrix, ErrorMatrix})
7098
+
7100
7099
  let EStarStar_1_xH = Matrix.Multiply(Matrix.Inverse(ErrorMatrix), HypothesisMatrix)
7101
7100
  let EigenValues: any = Matrix.EigenValues(EStarStar_1_xH);
7102
7101
  let eigenWilk = Product(EigenValues.map(l => {return 1/(1+l)}))
@@ -7529,8 +7528,8 @@ function Combinatrix(values: any[][]){
7529
7528
 
7530
7529
  export function DescriptiveStatistics(data: number[]){
7531
7530
  return {
7532
- Mean: Mean(data),
7533
7531
  N: data.length,
7532
+ Mean: Mean(data),
7534
7533
  StDev: StDev.S(data),
7535
7534
  SE: StandardError(data)
7536
7535
  }
@@ -8232,10 +8231,11 @@ export const NonparametricTesting = {
8232
8231
  }
8233
8232
  }
8234
8233
  },
8235
- KruskallWallis(data: number[][]){
8234
+ KruskalWallis(data: any[][]){
8236
8235
  let combinedData:any = [];
8237
8236
  data.forEach(g => {
8238
- combinedData.push(...g)
8237
+ let {name: groupName, data: groupData} = FormatInputData(g)
8238
+ combinedData.push(...groupData)
8239
8239
  })
8240
8240
 
8241
8241
  let ranks = Rank.Combined(data);
@@ -8257,6 +8257,7 @@ export const NonparametricTesting = {
8257
8257
  return {
8258
8258
  DescriptiveStatistics: data.map((group, i) => {
8259
8259
  return {
8260
+ Sample: FormatInputData(group).name ?? `Group ${i+1}`,
8260
8261
  N: group.length,
8261
8262
  Median: Median(group),
8262
8263
  MeanRank: avgRanks[i],
@@ -11365,12 +11366,12 @@ export function GeneralizedLinearModel(dependent: number[], factors: any, covari
11365
11366
  })
11366
11367
  })
11367
11368
 
11368
- ANOVA.push({Source: "Error", ...regressionModel.ANOVA.Residual})
11369
- ANOVA.push({Source: "Total", ...regressionModel.ANOVA.Total})
11369
+ ANOVA.push({Source: "Error", DF: regressionModel.ANOVA.Residual.DF, AdjSS: regressionModel.ANOVA.Residual.SS, AdjMS: regressionModel.ANOVA.Residual.MS})
11370
+ ANOVA.push({Source: "Total", DF: regressionModel.ANOVA.Total.DF, AdjSS: regressionModel.ANOVA.Total.SS})
11370
11371
 
11371
11372
  return {
11372
11373
  ANOVA,
11373
- Coefficients: regressionModel.Coeffecients,
11374
+ Coefficients: regressionModel.Coefficients,
11374
11375
  ModelSummary: {
11375
11376
  AdjRSq: regressionModel.AdjRSq,
11376
11377
  MultipleR: Math.sqrt(regressionModel.RSq),
@@ -11425,12 +11426,12 @@ export function MultipleLinearRegression(dependent: number[], factors: any, inte
11425
11426
  let xTy = Matrix.Multiply(Matrix.Transpose(x), y);
11426
11427
  let betaEstimators = Matrix.Multiply(inv_xTx, xTy);
11427
11428
 
11428
- let coeffecients = {
11429
+ let coefficients = {
11429
11430
  }
11430
11431
  for(let i = 0; i < betaEstimators.length; i ++){
11431
11432
  let fName = fKeys[i];
11432
- coeffecients[fName] = {
11433
- Coeffecient: betaEstimators[i][0]
11433
+ coefficients[fName] = {
11434
+ Coefficient: betaEstimators[i][0]
11434
11435
  }
11435
11436
  }
11436
11437
 
@@ -11473,7 +11474,7 @@ export function MultipleLinearRegression(dependent: number[], factors: any, inte
11473
11474
  SS: SST
11474
11475
  }
11475
11476
  },
11476
- Coeffecients: coeffecients,
11477
+ Coefficients: coefficients,
11477
11478
  S: S,
11478
11479
  AdjRSq: AdjRSq,
11479
11480
  RSq: RSq,
@@ -12274,7 +12275,7 @@ export function ANOMEChartEMP(operators: any[], parts: any[], responses: any[],
12274
12275
  let g = Unique(parts).length * byTreatments.length;
12275
12276
  let m = rData.length / g;
12276
12277
  let d2 = UnbiasingConstant.D2prime(g, m)
12277
- console.log(d2)
12278
+
12278
12279
  let Aα = (tα_2/d2) * Math.sqrt(1/n)
12279
12280
  let LDL = XbarBar - Aα * Rbar
12280
12281
  let UDL = XbarBar + Aα * Rbar
@@ -12326,7 +12327,7 @@ export function ANOMRChartEMP(operators: any[], parts: any[], responses: any[],
12326
12327
  byTreatments.forEach((t, ti) => {
12327
12328
  let {name: tName, data: tData} = FormatInputData(t);
12328
12329
  let rng = Mean(tData);
12329
- console.log({rng, tData})
12330
+
12330
12331
  dataset.values.push(new Point(ti, rng));
12331
12332
  chartSettings.axis.x.customGridlines.push(new CustomGridline(ti, tName))
12332
12333
  })
@@ -12662,7 +12663,7 @@ export function GageLinearityAndBias(parts: any[], referenceValues: number[], re
12662
12663
  let σ = (Math.max(...biases) - Math.min(...biases)) / d2;
12663
12664
  t = bias / (σ/Math.sqrt(n))
12664
12665
  }
12665
- console.log(t, df)
12666
+
12666
12667
  let pValue = Distributions.T.cdf(-Math.abs(t), df) + Distributions.T.RightTail(Math.abs(t), df)
12667
12668
 
12668
12669
  partBiases.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qesuite",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Performs advanced statistical analysis of data. Specifically designed for engineering statistical analysis",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -0,0 +1,3 @@
1
+ - Added Export for RoundDigits()
2
+ - Changed GLM Error/Total SS & MS to follow Adj*S format of factors and covariates
3
+ - CHanged all instances of Coeffecient to Coefficient
@@ -0,0 +1,4 @@
1
+ - Changed Order of Descriptive Statistics so that N is before Mean
2
+ - Kruskal-Wallis now handles sample names
3
+ - Fixed Bug in Distributions.T.Inv() to allow use of the invTable for p < 0.5
4
+ - Changed Chebyshev to return k instead of k/10