IVarianceAnalysisSumSquared.BetweenGroup

Syntax

BetweenGroup: Double;

Description

The BetweenGroup property returns the sum of squared deviations between groups.

Example

To execute the example, add a link to the Stat system assembly.

Sub UserProc;
Var
    VA: ISmVarianceAnalysis;
    res: Integer;
    m: Array Of Double;
    SS: IVarianceAnalysisSumSquared;
Begin
    VA := New SmVarianceAnalysis.Create;
    m := New Double[53];
    m[00] := 1; m[01] := 4; m[02] := 1;
    m[10] := 2; m[11] := 3; m[12] := 2;
    m[20] := 3; m[21] := 3; m[22] := 1;
    m[30] := 4; m[31] := 1; m[32] := 2;
    m[40] := 5; m[41] := 1; m[42] := 1;
    VA.Data := m;
    VA.AnalysisType := VarianceAnalysisType.SingleFactor; //single-factor analysis
    VA.ConfidenceLevel := 0.05;
    res := VA.Execute;
    If res <> 0 Then
        Debug.WriteLine(VA.Errors);
    Else
        Debug.WriteLine("Sum of deviation squares");
        SS := VA.SumSquared;
        Debug.WriteLine("between groups: " + SS.BetweenGroup.ToString);
        Debug.WriteLine("within a group: " + SS.WithinGroup.ToString);
        Debug.WriteLine("total: " + SS.Total.ToString);
    End If;
End Sub UserProc;

Executing the example displays the results of the variance analysis in the console window:

Unit execution started

Sum of deviation squares

between groups: 6.53333333333333

within groups: 18.4

total: 24.9333333333333

Unit execution finished

See also:

IVarianceAnalysisSumSquared