ISmPairCorrelation.BalancedSample

Syntax

BalancedSample: Boolean;

Description

The BalancedSample property determines, which observations are used to estimate correlation coefficients.

Comments

This property is relevant if the following method of missing data treatment is used: MissingDataMethod.Casewise. The method of missing data treatment is selected in the ISmPairCorrelation.MissingData property.

Available Values of BalancedSample:

Example

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

Sub UserProc;
Var
    pc: SmPairCorrelation;
    m: Array[44Of Double;
    w: Array[4Of Double;
    res, i, j: Integer;
    PairCorr: Array Of Double;
Begin
    pc := New SmPairCorrelation.Create;
    // Set initial data
    m[00] := 10;  m[01] := 1;  m[02] := 62;  m[03] := -3;
    m[10] := 30;  m[11] := 2;  m[12] := 32;  m[13] := Double.Nan;
    m[20] := 3;   m[21] := 3;  m[22] := 22;  m[23] := -3;
    m[30] := 77;  m[31] := 4;  m[32] := 21;  m[33] := 3;
    pc.Data := m;
     // Set missing data treatment method
    pc.MissingData.Method := MissingDataMethod.Casewise;
    // Set weights vector
    w[0] := 1;  w[1] := 2;  w[2] := 2.2;  w[3] := 0.5;
    pc.Weights := w;
    // Determine data that will be used to estimate correlation
    pc.BalancedSample := False;
    // Run calculation and show results
    res := pc.Execute;
    If res <> 0 Then
        Debug.Write(pc.Errors);
    Else
        Debug.WriteLine("Matrix of paired correlation coefficients:");
        Debug.Indent;
        For i := 0 To pc.PairCorrelationMatrix.GetUpperBound(1Do
            For j := 0 To pc.PairCorrelationMatrix.GetUpperBound(2Do
                PairCorr := pc.PairCorrelationMatrix;
                Debug.Write(PairCorr[i, j].ToString + ", ");
            End For;
            Debug.WriteLine(" ");
        End For;
        Debug.Unindent;
    End If;
End Sub UserProc;

After executing the example the console window displays matrix of paired correlation coefficients.

See also:

ISmPairCorrelation