Stat Assembly > Stat Assembly Interfaces > ISmVarianceAnalysis > ISmVarianceAnalysis.SumSquared
SumSquared: IVarianceAnalysisSumSquared
The SumSquared property returns the sum of deviation squares.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
VA: SmVarianceAnalysis;
res: Integer;
m: Array Of Double;
SS: IVarianceAnalysisSumSquared;
UE: IVarianceAnalysisUnbiasedEstimation;
Begin
VA := New SmVarianceAnalysis.Create;
m := New Double[5, 3];
m[0, 0] := 1; m[0, 1] := 4; m[0, 2] := 1;
m[1, 0] := 2; m[1, 1] := 3; m[1, 2] := 2;
m[2, 0] := 3; m[2, 1] := 3; m[2, 2] := 1;
m[3, 0] := 4; m[3, 1] := 1; m[3, 2] := 2;
m[4, 0] := 5; m[4, 1] := 1; m[4, 2] := 1;
VA.Data := m;
VA.AnalysisType := VarianceAnalysisType.TwoFactor; // two-factor analysis
VA.ConfidenceLevel := 0.05;
res := VA.Execute;
If res <> 0 Then
Debug.WriteLine(VA.Errors);
Else
Debug.AssertMsg(False,"Results: ");
Debug.WriteLine("Sum of deviation squares");
SS := VA.SumSquared;
Debug.WriteLine("rows : " + SS.Rows.ToString);
Debug.WriteLine("columns : " + SS.Columns.ToString);
Debug.WriteLine("accuracy : " + SS.Accuracy.ToString);
Debug.WriteLine("Total: " + SS.Total.ToString);
Debug.WriteLine("Unbiased estimate of sum of deviation squares");
UE := VA.UnbiasedEstimation;
Debug.WriteLine("rows : " + UE.Rows.ToString);
Debug.WriteLine("columns : " + UE.Columns.ToString);
Debug.WriteLine("accuracy : " + UE.Accuracy.ToString);
End If;
End Sub UserProc;
Executing the example displays the results of the variance analysis in the console window:
Unit execution started
Results:
Sum of deviation squares
rows: 0.266666666666667
columns: 6.53333333333333
accuracy: 18.1333333333333
Total: 24.9333333333333
Unbiased estimated sum of deviation squares
rows: 0.0666666666666667
columns: 3.26666666666667
accuracy: 2.26666666666666
Unit execution finished
See also: