SAS EM - Replacing missing interval variable values with user-defined value

1.8k Views Asked by At

How do I replacing missing interval variable values with a user-defined value?

I have been through all the options I can see in the Impute and Replacement nodes, but have not found anything. Google returns a 2003 SAS document that shows how you used to be able to do this with the Replacement node, back when there was an imputation column in there.

I'm using the SAS Enterprise Miner OnDemand version 14.1 (the current version).

1

There are 1 best solutions below

0
On BEST ANSWER

You can do this with the Impute node. You can find this under the Modify tab in the SEMMA list.

If all else fails, you can always use a SAS code node and the provided EM macro variables to import/export your datasets and modify them as you need.

data &em_export_train
     &em_export_validate
     &em_export_test;

    set &em_import_train(in=train)
        &em_import_validate(in=valid)
        &em_import_test(in=test);

    if(missing(var) ) then var = <new value>;

    select;
          when(train) output &em_export_train;
          when(validate) output &em_export_validate;
          when(test) output &em_export_test;
          otherwise;
    end;
run;