MVFILL procedure

Replaces missing values in a vector with the previous non-missing value in that vector (J.T.N.M. Thissen).


No options


Parameter

VECTORS = vectors
Variates, texts or factors whose missing values are replaced by the previous non-missing value of that vector


Description

A data matrix often has the values of a grouping variable in one column and values of quantitative measurements in other columns. However, one common method of data entry is to specify the value of the grouping variable only in the first row of each group. Procedure MVFILL replaces the missing values in a vector (variate, text or factor) with the previous non-missing value in that vector. If the first values of the VECTOR parameter are missing there is then no previous non-missing value, and these values remain missing.


Options: none. Parameter: VECTORS.


Method

The procedure uses the data manipulation functions SHIFT, DIFFERENCE and NEXPAND.


Action with RESTRICT

Restrictions are ignored. This means that missing values are replaced in the same way as for unrestricted vectors. However, after the procedure the vectors are restricted in the same way as before.