ILanerResultsBoxResults.Correlation

Syntax

Correlation: ILanerResultsBoxCorrelation;

Description

The Coerrelation property returns parameters required to work with values of the Correlation tab.

Comments

Correlation values are computed only for the series calculated using the Linear Regression method.

Example

Executing this example requires a form, a button with the identifier Button1 located on this form, the LanerBox component, the LanerResultsBox component with the LanerResultsBox1 name and the UiErAnalyzer component used as a data source for LanerBox and LanerResultsBox. Workbook of the time series database must be loaded to UiErAnalyzer1.

This example is executed on clicking the button.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Results: ILanerResultsBoxResults;
        Correlation: ILanerResultsBoxCorrelation;
        i, j: Integer;
        s: string;
    Begin
        Results := LanerResultsBox1.Results;
        Correlation := Results.Correlation;
        s := "";
        For i := 0 To Correlation.TermCount - 1 Do
            s := s + "    " + Correlation.Comment(i);
        End For;
        Debug.WriteLine(s);
        s := "";
        For i := 0 To Correlation.TermCount - 1 Do
            s := s + "    " + Correlation.Name(i);
        End For;
        Debug.WriteLine(s);
        For i := 0 To Correlation.TermCount - 1 Do
            s := "";
            For j := 0 To Correlation.TermCount - 1 Do
            s := s + "    " + Correlation.Value(i, j).ToString;
            End For;
            Debug.WriteLine(s);
        End For;
    End Sub Button1OnClick;

After executing this example the console window shows a correlation table that contains name,value, and comment for the variables taking part in the calculations. For example:

Comments:
    New series 1    Nigeria|BCA|A[t]    Nigeria|BCI|A[t]
Correlation table:
    Y    X1    X2
    1    -0.68230830806241394    0.49928242789261545
    -0.68230830806241394    1    -0.1197660822009501
    0.49928242789261545    -0.1197660822009501    1

See also:

ILanerResultsBoxResults