MissingData: IMissingData;
The property is read-only.
The MissingData property returns an object containing parameters of missing data treatment in the source series.
The following missing data treatment methods cannot be used: MissingDataMethod.Casewise and MissingDataMethod.None.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. Three modeling variables with the INPUT_FILL_GRAPS, OUTPUT_FILL_GRAPS, and VAR_EXPL identifiers must be available in this container.
Sub Main;
Var
MB: IMetabase;
Cont: IMetabaseObjectDescriptor;
Descript: IMetabaseObjectDescriptor;
ModelKey: Integer;
CrInf: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Model: IMsModel;
Obj_x1: IMetabaseObject;
Transform: IMsFormulaTransform;
Out: IMsFormulaTransformVariables;
TransformVar: IMsFormulaTransformVariable;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
FillGaps: IMsFillGapsTransform;
ModelVar_x1: IVariableStub;
TermInfo: IMsFormulaTermInfo;
Begin
MB := MetabaseClass.Active;
Cont := Mb.ItemById("CONT_MODEL").Bind;
ModelKey := Cont.Key;
// Create the new model in modeling container
CrInf := MB.CreateCreateInfo;
CrInf.ClassId := MetabaseObjectClass.KE_CLASS_MSMODEL;
CrInf.Name := "New_Fill_Graps_Model";
CrInf.Parent := Cont;
CrInf.Permanent := True;
MObj := MB.CreateObject(CrInf).Edit;
Model := MObj As IMsModel;
Transform := Model.Transform;
// Determine output variable
Descript := MB.ItemByIdNamespace("INPUT_FILL_GRAPS", ModelKey);
Obj_x1 := Descript.Bind;
ModelVar_x1 := Obj_x1 As IVariableStub;
Out := Transform.Outputs;
Out.Clear;
Out.Add(ModelVar_x1);
// Determine model type
TransformVar := Out.Item(0);
Slice := TransformVar.Slices.Add(Null);
Selector := Transform.CreateSelector;
Selector.Slice := Slice;
Formula := Transform.Transform(Selector);
Formula.Kind := MsFormulaKind.FillGaps;
FillGaps := Formula.Method As IMsFillGapsTransform;
TermInfo := Transform.CreateTerminfo;
TermInfo.Slice := Slice;
FillGaps.InputFactorTerm := TermInfo;
// Set variable in which results should be unloaded
Descript := MB.ItemByIdNamespace("OUTPUT_FILL_GRAPS", ModelKey);
Obj_x1 := Descript.Bind;
ModelVar_x1 := Obj_x1 As IVariableStub;
FillGaps.Fitted := ModelVar_x1;
// Determine the parameters of model calculation
FillGaps.MissingData.Method := MissingDataMethod.Overlay;
Descript := MB.ItemByIdNamespace("VAR_EXPL", ModelKey);
Obj_x1 := Descript.Bind;
ModelVar_x1 := Obj_x1 As IVariableStub;
TransformVar := Transform.Inputs.Add(ModelVar_x1);
Slice := TransformVar.Slices.Add(Null);
TermInfo.Slice := Slice;
FillGaps.Specified := TermInfo;
MObj.Save;
End Sub Main;
After executing the example, the New_Fill_Graps_Model model that uses the missing data treatment for calculation is created in the modeling container. The output variable is INPUT_FILL_GRAPS, the results are loaded to the OUTPUT_FILL_GRAPS variable. The skipped values of output series are replaced with values from the series that is determined by the VAR_EXPL variable.
See also: