CC02
Efficient Interpolation Calculation

Julia Zhang, GlaxoSmithKlie
David Chen, EDP Contract Services

Often times, programmers and statisticians encounter missing values in data points while constructing data sets for statistical analysis. Depending on the type of analysis being performed, it may be necessary to impute these missing values. Linear interpo lation i.e., replacing the missing values with results derived from non-missing, adjacent values, is an example of imputation. Generally, linear interpolation implemented in a data step has involved use of LAG function, which returns adjacent values store d previously in the lag queue. There is, however, no corresponding SASŪ function to return subsequent, non-missing, adjacent, values from observations not already read/SET into the step. Retrieving the necessary non-missing, adjacent values can be accomp lished using a combination of the OPEN, FETCHOBS, VARNUM, GETVARN, GETVARC, and CLOSE functions in Base SAS. This paper illustrates a simple and efficient data step implementation of linear interpolation using the aforementioned functions.