IMs2SLSTransform.StatCoefficients

Syntax

StatCoefficients(Coord: IMsFormulaTransformCoord): IModelCoefficients;

Parameters

Coord. Output variable slice, for which calculation is executed.

Description

The StatCoefficients property returns values of summary statistics calculated for identified equation coefficients.

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. A model with the New_2SLS identifier created in this container uses the method of linear regression for calculation (instrumental variables estimation).

Add links to the Metabase, Ms, Stat system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Model: IMsModel;
    Trans: IMsFormulaTransform;
    VarTrans: IMsFormulaTransformVariable;
    Tree: IMsFormulaTransformSlicesTree;
    Slice: IMsFormulaTransformSlice;
    Selector: IMsFormulaTransformSelector;
    Formula: IMsFormula;
    SLS2: IMs2SLSTransform;
    Calc: IMsModelCalculation;
    Period: IMsModelPeriod;
    Coord: IMsFormulaTransformCoord;
    Coef: ICoefficients;
    a: Array Of Double;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Model := MB.ItemByIdNamespace("New_2SLS", MB.ItemById("MODEL_SPACE").Key).Bind As IMsModel;
    Trans := Model.Transform;
    VarTrans := Trans.Outputs.Item(0);
    Tree := VarTrans.SlicesTree(VarTrans);
    Slice := Tree.CreateSlice(1);
    Selector := Trans.CreateSelector;
    Selector.Slice := Slice;
    Formula := Trans.Transform(Selector);
    SLS2 := Formula.Method As IMs2SLSTransform;
    Calc := Model.CreateCalculation;
    Period := Calc.Period;
    Period.IdentificationStartDate := DateTime.ComposeDay(19900101);
    Period.IdentificationEndDate := DateTime.ComposeDay(20001231);
    Period.ForecastStartDate := DateTime.ComposeDay(20010101);
    Period.ForecastEndDate := DateTime.ComposeDay(20101231);
    Coord := Trans.CreateCoord(VarTrans);
    SLS2.Identify(Calc As IMsMethodCalculation, Coord);
    Coef := SLS2.StatCoefficients(Coord).Coefficients;
    Debug.WriteLine("Values");
    a := Coef.Estimate;
    For i := 0 To a.Length - 1 Do
        Debug.WriteLine(a[i]);
    End For;
    Debug.WriteLine("Probability");
    a := Coef.Probability;
    For i := 0 To a.Length - 1 Do
        Debug.WriteLine(a[i]);
    End For;
    Debug.WriteLine("Standard error");
    a := Coef.StandardError;
    For i := 0 To a.Length - 1 Do
        Debug.WriteLine(a[i]);
    End For;
    Debug.WriteLine("t-statistic value");
    a := Coef.TStatistic;
    For i := 0 To a.Length - 1 Do
        Debug.WriteLine(a[i]);
    End For;
End Sub UserProc;

After executing the example the model equation coefficients are identified. Summary statistics values, calculated for the coefficients, are displayed in the console window.

See also:

IMs2SLSTransform