Resources

Interpolating Irregular Observations

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: expex03.sas
 Description: Example program from SAS/ETS User's Guide,
              The EXPAND Procedure
       Title: Interpolating Irregular Observations
     Product: SAS/ETS Software
        Keys: time series conversion and interpolation
        PROC: EXPAND
       Notes:

--------------------------------------------------------------*/

ods graphics on;

data samples;
  input date : date9. defects @@;
  label defects = "Defects per 1000 Units";
  format date date9.;
datalines;
13jan1992    55    27jan1992   73    19feb1992   84    8mar1992   69
27mar1992    66     5apr1992   77    29apr1992   63   11may1992   81
25may1992    89     7jun1992   94    23jun1992  105   11jul1992   97
15aug1992   112    29aug1992   89    10sep1992   77   27sep1992   82
;

title "Sampled Defect Rates";
proc print data=samples;
run;

proc expand data=samples
            out=monthly
            to=month
            plots=(input output);
  id date;
  convert defects / observed=(beginning,average);
run;

title "Estimated Monthly Average Defect Rates";
proc print data=monthly;
run;