Search code examples
sas

SAS iterpolation : alternative to proc expand


From annual data :

enter image description here

I would like to create the the data per day but I can't use the proc expand because the SAS ETS is not available.

Thank you for your suggestions.


Solution

  • Something like this is a basic approach perhaps:

    • create a list of dates for interpolation
    • merge have data (shown above, not included in code below)
    • Plot to see if linear pattern, (looks somewhat exponential/curved)
    • run linear regression, saving predicted values
    • plot interpolated values against actual values
    data years;
    do date='30Jun2017'd to '30Jun2022'd;
    output;
    end;
    run;
    
    
    
    data have;
    merge years have;
    by date;
    format date date9.;
    run;
    
    proc sgplot data=have;
    series x=date y=px_last;
    run;
    
    proc reg data=have plots;
    model px_last = date;
    output out=pred p=predicted_value;
    run;
    
    proc sgplot data=pred;
    series x=date y=predicted_Value;
    scatter x=date y=px_last;
    run;