/*-----------------------------------------------------------------
            S A S   S A M P L E   L I B R A R Y                   
                                                                  
      NAME: tregint                                               
     TITLE: Use the PLOTS(INTERPOLATE) Option in PROC TRANSREG    
   PRODUCT: STAT                                                  
    SYSTEM: ALL                                                   
      KEYS: regression analysis, transformations                  
     PROCS: TRANSREG                                              
      DATA:                                                       
                                                                  
   SUPPORT: saswfk                UPDATE: July 25, 2010           
       REF: PROC TRANSREG, DETAILS, INTERPOLATE                   
      MISC:                                                       
-----------------------------------------------------------------*/

title 'Smoother Interpolation with PLOTS(INTERPOLATE)';

data a;
   input c y x;
   output;
   datalines;
1 1 1
1 2 2
1 4 3
1 6 4
1 7 5
2 3 1
2 4 2
2 5 3
2 4 4
2 5 5
;


ods graphics on;

proc transreg data=a plots=(tran fit) ss2;
   model ide(y) = pbs(x) * class(c / zero=none);
run;

data b;
   set a end=eof;
   output;
   if eof then do;
      y = .;
      do x = 1 to 5 by 0.05;
         c = 1; output;
         c = 2; output;
      end;
   end;
run;

proc transreg data=b plots(interpolate)=(tran fit) ss2;
   model ide(y) = pbs(x) * class(c / zero=none);
run;