ConstantMode: InterceptMode;
The ConstantMode property determines a 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).
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;
// Get model
Model := MB.ItemByIdNamespace("New_2SLS", MsDescrKey).Edit As IMsModel;
ModelTrans := Model.Transform;
// Set up model calculation parameters
Formula := ModelTrans.FormulaItem(0);
SLS := Formula.Method As IMs2SLSTransform;
SLS.ConstantMode := InterceptMode.ManualEstimate;
SLS.ConstantValue := 2.9;
// Save model calculation parameters
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example constant value for the model is set.
See also: