ISmVarianceAnalysis.AnalysisType

Syntax

AnalysisType: VarianceAnalysisType;

Description

The AnalysisType property determines the type of variance analysis.

Example

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

Sub UserProc;
Var
    VA: ISmVarianceAnalysis;
    res: Integer;
    m: Array[53Of Double;
    SS: IVarianceAnalysisSumSquared;
    DF: IVarianceAnalysisDegreeOfFreedom;
    UE: IVarianceAnalysisUnbiasedEstimation;
    FS, FC, P: IVarianceAnalysisStatistics;
Begin
    VA := New SmVarianceAnalysis.Create;
    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("Results: ");
        Debug.WriteLine("Sum of deviation squares");
        SS := VA.SumSquared;
        Debug.Indent;
        Debug.WriteLine("between groups: " + SS.BetweenGroup.ToString);
        Debug.WriteLine("within a group: " + SS.WithinGroup.ToString);
        Debug.WriteLine("total: " + SS.Total.ToString);
        Debug.Unindent;
        Debug.WriteLine("Number of degrees of freedom");
        DF := VA.DegreeOfFreedom;
        Debug.Indent;
        Debug.WriteLine("between groups: " + DF.BetweenGroup.ToString);
        Debug.WriteLine("within a group: " + DF.WithinGroup.ToString);
        Debug.WriteLine("total: " + DF.Total.ToString);
        Debug.Unindent;
        Debug.WriteLine("Unbiased estimate of sum of deviation squares");
        UE := VA.UnbiasedEstimation;
        Debug.Indent;
        Debug.WriteLine("between groups: " + UE.BetweenGroup.ToString);
        Debug.WriteLine("within groups: " + UE.WithinGroup.ToString);
        Debug.Unindent;
        Debug.WriteLine("Value of Fisher statistics ");
        FS := VA.FisherStatistics;
        Debug.WriteLine(FS.OneFactorAnalysis.ToString);
        Debug.WriteLine("Critical value of Fisher statistics ");
        FC := VA.FisherCritical;
        Debug.WriteLine(FC.OneFactorAnalysis.ToString);
        Debug.WriteLine("Probability ");
        P := VA.Probability;
        Debug.WriteLine(P.OneFactorAnalysis.ToString);
        If VA.VarianceEqualByRows Then
            Debug.WriteLine("Fstat < Fcrit. Hypothesis on equal group averages is accepted");
        Else
            Debug.WriteLine("Fstat > Fcrit. Hypothesis on equal group averages is rejected");
        End If;
    End If;
End Sub UserProc;

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

Sum of deviation squares

    between groups: 0,266666666666667

    within groups: 24,6666666666667

   sum: 24,9333333333333

Number of degrees of freedom

    between groups: 4

    within groups: 10

    sum: 14

Unbiased estimated sum of deviation squares

    between groups: 0,0666666666666667

    within groups: 2,46666666666667

Fisher statistics value: 0,027027027027027

Fisher statistics critical value: 3,47804969076512

Probability: 0,99833254475293

Fstat < Fcrit. Hypothesis on the equality of group means is accepted.

See also:

ISmVarianceAnalysis