Replace missing values with a "smoothed" value

This macro replaces the missing values in a column using a smoothing technique that handles missing values by assuming a linear relationship. This macro replaces missing values in a column of data with the "average" of the data around them. One missing value is replaced by the average of the observations before and after it. Multiple missing values are replaced by "steps" between the known values.

This macro replaces the missing values in a column using a smoothing technique that handles missing values by assuming a linear relationship. This macro replaces missing values in a column of data with the "average" of the data around them. One missing value is replaced by the average of the observations before and after it. Multiple missing values are replaced by "steps" between the known values.

Download the Macro

Be sure that Minitab knows where to find your downloaded macro. Choose File > Options > General. Under Macro location browse to the location where you save macro files.

Important

If you use an older web browser, when you click the Download button, the file may open in Quicktime, which shares the .mac file extension with Minitab macros. To save the macro, right-click the Download button and choose Save target as.

Required Inputs

  • A column of numeric values
  • An empty column to store the results

Optional Inputs

Running the Macro

For example, you want to smooth the data in C1, and store the original data in C2.To run the macro, choose View > Command Line/History and type:

%SMOOTH C1 C2

Click Run.