ConstantMode: InterceptMode;
The ConstantMode property determines the mode of setting model constant.
If the ConstantMode is set to InterceptMode.ManualEstimate, the constant is set using the IMs2SLSTransform.ConstantValue property.
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).
It is also necessary to add links to the Metabase, Ms, Stat system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MsDescrKey: Integer;
Model: IMsModel;
ModelTrans: IMsFormulaTransform;
Formula: IMsFormula;
SLS: IMs2SLSTransform;
Begin
Mb := MetabaseClass.Active;
MsDescrKey := Mb.ItemById("MODEL_SPACE").Key;
// Receive the model
Model := MB.ItemByIdNamespace("New_2SLS", MsDescrKey).Edit As IMsModel;
ModelTrans := Model.Transform;
// Setting of parameters of calculation of model
Formula := ModelTrans.FormulaItem(0);
SLS := Formula.Method As IMs2SLSTransform;
SLS.ConstantMode := InterceptMode.ManualEstimate;
SLS.ConstantValue := 2.9;
// Save parameters of calculation of model
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example constant value for the model is set.
See also: