Show contents 

Ms > Ms Assembly Interfaces > IMsLinearRegressionTransform > IMsLinearRegressionTransform.StatCoefficients

IMsLinearRegressionTransform.StatCoefficients

Syntax

StatCoefficients(Coord: IMsFormulaTransformCoord): IModelCoefficients;

Parameters

Coord. Output variable slice for which the calculation is performed.

Description

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

Example

Executing the example requires that the modeling container includes the model that uses the method of linear regression for calculation.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Model: IMsModel;
    Trans: IMsFormulaTransform;
    VarTrans: IMsFormulaTransformVariable;
    Tree: IMsFormulaTransformSlicesTree;
    Slice: IMsFormulaTransformSlice;
    Selector: IMsFormulaTransformSelector;
    Formula: IMsFormula;
    Linear: IMsLinearRegressionTransform;
    Calc: IMsModelCalculation;
    Coord: IMsFormulaTransformCoord;
    PairArr: Array Of Double;
    i, j: Integer;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemByIdNamespace("NEW_LINREG", MB.ItemById("KONT_MODEL").Key).Bind;
    Model := MObj As IMsModel;
    Trans := Model.Transform;
    VarTrans := Trans.Outputs.Item(0);
    Tree := VarTrans.SlicesTree(VarTrans);
    Slice := Tree.CreateSlice(1);
    Selector := Model.Transform.CreateSelector;
    Selector.Slice := Slice;
    Formula := Model.Transform.Transform(Selector);
    Linear := Formula.Method As IMsLinearRegressionTransform;
    Calc := Model.CreateCalculation;
    Calc.Period.IdentificationStartDate := DateTime.ComposeDay(19900101);
    Calc.Period.IdentificationEndDate := DateTime.ComposeDay(20001231);
    Calc.Period.ForecastStartDate := DateTime.ComposeDay(20010101);
    Calc.Period.ForecastEndDate := DateTime.ComposeDay(20101231);
    Coord := Trans.CreateCoord(VarTrans);
    //identification of equation
    Linear.Identify(Calc As IMsMethodCalculation, Coord);
    Coef := Linear.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. The console window displays summary statistics values calculated for the coefficients.

See also:

IMsLinearRegressionTransform