IMsBinaryRegressionTransform.BinaryDistr

Syntax

BinaryDistr: BinaryDistrType;

Description

The BinaryDistr property determines a binary regression model.

Comments

The property is set to BinaryDistrType.Logit by default. The Logit-model is used, that is, the logistic normal distribution is considered.

Example

Executing the example requires that the repository contains a modeling container with the MS identifier containing a binary choice model (maximum likelihood estimation) with the BCHOICE_MODEL identifier.

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

Sub UserProc;
Var
    Mb: IMetabase;
    MsKey: Integer;
    Model: IMsModel;
    ModelTransform: IMsFormulaTransform;
    ModelFormula: IMsFormula;
    BinaryRegr: IMsBinaryRegressionTransform;
    Explanatories: IMsCompositeFormulaTermSetList;
    i: Integer;
    Factor: IMsCompositeFormulaTermSet;
Begin
    Mb := MetabaseClass.Active;
    // Get modeling container key
    MsKey := Mb.ItemById("MS").Key;
    // Get model calculated by binary regression method
    Model := Mb.ItemByIdNamespace("BCHOICE_MODEL", MsKey).Edit As IMsModel;
    // Get model calculation parameters
    ModelTransform := Model.Transform;
    ModelFormula := ModelTransform.FormulaItem(0);
    // Get binary regression calculation parameters
    BinaryRegr := ModelFormula.Method As IMsBinaryRegressionTransform;
    // Set binary regression model
    BinaryRegr.BinaryDistr := BinaryDistrType.Probit;
    // Set threshold probability value for including objects to the 0 or the 1 group
    BinaryRegr.ClassificationCutOff := 0.7;
    // Set likelihood function optimization accuracy
    BinaryRegr.Tolerance := 0.00001;
    // Set manually initial values of explanatory variables
    BinaryRegr.UseDefaultInitValues := False;
    Explanatories := BinaryRegr.Explanatories;
    For i := 0 To Explanatories.Count - 1 Do
        Factor := Explanatories.Item(i);
        Factor.InitValue := 0.1;
    End For;
    // Determine that constant value will be estimated
    BinaryRegr.ConstantMode := InterceptMode.AutoEstimate;
    // Set manually constant initial value
    BinaryRegr.ConstantInitValue := 0.4;
   BinaryRegr.ConstantValue := 0.4;
    // Specify type of values loaded to modeling and forecasting series
    BinaryRegr.OutputType := MsBinaryRegressionOutputType.Probability;
    // Save model
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the following model calculation options will be changed:

See also:

IMsBinaryRegressionTransform