Resources

Example 2 for PROC HPREG

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: hpregex2                                            */
/*   TITLE: Example 2 for PROC HPREG                            */
/*    DESC: Simulated Data                                      */
/*                                                              */
/* PRODUCT: STAT                                                */
/*  SYSTEM: ALL                                                 */
/*    KEYS: BACKWARD selection, Single-Machine                  */
/*          and Distributed Modes                               */
/*   PROCS: HPREG                                               */
/*                                                              */
/* SUPPORT: Robert Cohen                                        */
/****************************************************************/


 data ex2Data;
    array x{1000};

    do i=1 to 10000;
       y=1;
       sign=1;

       do j=1 to 1000;
          x{j} = ranuni(1);
          if j<=20  then do;
            y = y + sign*j*x{j};
            sign=-sign;
          end;
       end;
       y = y + 5*rannor(1);
       output;
   end;
 run;


 proc hpreg data=ex2Data;
     model y = x: ;
     selection method = backward;
     performance details;
 run;



 /*----------------------------------------------------------------*/
 /*---In order to run this code in distributed mode, you need   ---*/
 /*---to set the macro variables GRIDHOST and GRIDINSTALLLOC to ---*/
 /*---resolve to appropriate values for your grid installation. ---*/
 /*----------------------------------------------------------------*/

 proc hpreg data=ex2Data;
     model y = x: ;
     selection method = backward;
     performance details nodes = 10
                 host="&GRIDHOST" install="&GRIDINSTALLLOC";
 run;