Creating Multivariate Control Charts for Phase II

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: MVPMNEX2                                            */
/*   TITLE: Creating Multivariate Control Charts for Phase II   */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Phase II Analysis                                   */
/*   PROCS: MVPMONITOR                                          */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: saswgr                                              */
/*     REF: PROC MVPMONITOR, Example 2                          */
/*                                                              */
/****************************************************************/

data flightDelays;
   label flightDate='Date';
   format flightDate MMDDYY8.;
   input flightDate :MMDDYY8. region $ AA CO DL F9 FL NW UA US WN;
   datalines;
02/01/07 MW 14.9  7.1  7.9  8.5 14.8  4.5  5.1 13.4  5.1
02/01/07 NE 15.7  7.1  8.6  6.3 14.6  6.2  7.0 11.0  6.4
02/01/07 NW 17.8  2.6  6.1 28.8 11.6  6.1 11.6 27.3  3.7
02/01/07 SC 19.9  8.3 13.9  4.9 25.8 15.3  9.0 15.1 12.8
02/01/07 SE 16.1  1.9  8.7  8.7 15.1 18.3  4.0 10.4  6.5
02/01/07 SW 19.3  7.8  4.8 11.5 34.7  7.4  7.3 12.0  5.6
02/02/07 MW 14.3  9.6 14.1  6.2 12.8  6.0  3.9 15.3 11.4
02/02/07 NE 16.0 19.4 10.7  6.4 19.0  6.1  8.3 14.4 14.2
02/02/07 NW 16.6  9.9  1.9 27.0  8.6 11.0 10.2  9.4 11.4
02/02/07 SC 23.7  9.4 21.1  5.3 16.9 10.4  5.3 14.5 18.6
02/02/07 SE 16.8  6.4  9.3  8.6 12.5  6.2  5.0 13.3 11.9
02/02/07 SW 19.0  8.3  5.3  9.0 14.6 10.5  5.3 11.8 10.1
02/03/07 MW 23.0  6.1  1.7  0.9 11.9 15.2  9.5 18.4  7.6
02/03/07 NE 14.5  1.5  5.4 13.3 13.6  9.7 16.6  7.5  9.9
02/03/07 NW  8.3  6.8  7.2  2.8 12.1 10.5 12.9 18.7  5.3
02/03/07 SC  5.0  2.1  5.1 -1.3 18.0  8.1  9.7 10.5  3.4
02/03/07 SE 10.8 -0.5  3.3  8.8 15.0 13.1 12.0  9.5 11.2
02/03/07 SW 14.5  8.9  2.7  5.0 29.9 12.7  7.1  8.1  3.1
02/04/07 MW  6.5  6.3  3.9 -0.2  8.4 18.8  6.2  8.8  8.0
02/04/07 NE 12.4 14.3  5.8  0.7 11.8 20.1 11.2  8.6  8.1
02/04/07 NW 14.4 11.1 10.6  3.7 31.1 23.5  7.5 19.0  4.5
02/04/07 SC  4.2  7.3  4.5 -3.0  9.5 10.4  8.6  6.3  6.7
02/04/07 SE  8.3  3.2  3.7  4.2  9.6 10.6  4.7  8.9 10.8
02/04/07 SW  8.9  5.8  6.2  2.9 12.9 15.5  5.6  8.7  4.0
02/05/07 MW 12.0 14.1  3.3 -1.3 10.0 13.1 22.8 16.5 11.5
02/05/07 NE 19.8 27.6  7.3 16.1 13.3 14.8 39.9 16.4  9.7
02/05/07 NW 19.4  2.5  3.5  7.1 10.4  9.3 25.1 11.5  9.0
02/05/07 SC  8.3  8.1  3.3 10.3  6.7 10.7 22.5 18.2  5.8
02/05/07 SE 16.4  3.7  3.4  0.2 11.7  7.3 24.3 14.3 10.5
02/05/07 SW 12.3  9.4  4.6 -1.3 22.9 23.3 20.7 13.3  6.8
02/06/07 MW 31.9  8.6  4.9  2.0 11.9 21.9 29.0 15.5 15.2
02/06/07 NE 20.5 12.2  0.2 -4.8  3.7 14.2 41.7  4.9  9.2
02/06/07 NW 20.4 16.1 13.1  5.3 -3.1 43.7 28.6  8.0 10.1
02/06/07 SC  8.3  2.8  1.1 -0.3  9.9 16.6 27.8 10.6  3.8
02/06/07 SE 14.2  0.6  0.5 -1.3  4.4 13.5 26.0  5.3  9.5
02/06/07 SW 22.9  2.0  0.2  6.1 -1.9 38.4 18.6  7.9  6.2
02/07/07 MW 14.2  3.0  2.1 -0.9 -0.6  7.8 19.9  8.6  6.4
02/07/07 NE  8.3  4.1  3.4  4.2 -2.3  6.3 24.9  8.7  4.4
02/07/07 NW 13.7  4.1  3.8  3.3 -6.2 12.0 36.0  7.2  7.2
02/07/07 SC  8.0  2.0  2.4  0.2 -2.8  7.3 16.3 10.5 11.5
02/07/07 SE 11.2  0.3  3.3  5.5 -1.6  6.8 11.1  6.5  8.3
02/07/07 SW 17.4  8.1  1.5 15.2 17.6 17.3 26.0 10.1  8.4
02/08/07 MW  6.5  6.8  1.8  7.7  1.3  6.9  6.1  9.2  5.4
02/08/07 NE  4.7 14.1  1.8 18.1 -1.9 10.2  5.4  5.8  3.7
02/08/07 NW 14.6  9.5 10.2 18.4 -1.7 10.5 17.9 15.0  4.2
02/08/07 SC  4.9  4.3  3.2  4.8 -1.9  7.0  6.9 11.5  6.7
02/08/07 SE  8.2  2.8  1.1 11.5 -0.2  4.7 10.4  5.7  6.1
02/08/07 SW 11.9 11.3  2.2 14.9 -1.9 16.0 14.2  9.6  6.0
02/09/07 MW 12.8  9.4  5.5  9.3 -0.2  4.6  7.6  7.8  7.5
02/09/07 NE 16.7 15.0  3.5 11.8  0.8  7.3 11.1  7.2  5.1
02/09/07 NW 34.1  2.7  3.3 13.3  8.5 11.5 13.6 12.3 10.5
02/09/07 SC  8.8  6.4  0.5 11.9 -2.8  5.1  8.2 15.6 13.5
02/09/07 SE 11.5  5.6  3.7  8.0  0.0  8.7 11.0 10.9 10.7
02/09/07 SW 11.8 16.0  5.7 21.9  5.3  9.4 20.1 12.8 13.7
02/10/07 MW  9.4  3.5  1.5 -0.2  2.2  9.9  3.1 12.5  3.0
02/10/07 NE  6.2  0.6  2.6  9.3  3.0  4.0  4.0  6.9  1.9
02/10/07 NW  7.6  0.4  4.3 -1.4  3.3 13.6  9.2  9.1  6.4
02/10/07 SC  6.4  0.6  0.3 -4.3  2.2 -1.9  3.1  8.8  3.5
02/10/07 SE 11.3  1.3  1.2  8.8  0.7  4.6  4.1  8.7  3.4
02/10/07 SW 11.1  9.2  6.8  2.4  6.4 12.1 10.1  8.3  2.7
02/11/07 MW 12.9  5.4  0.9  6.8  2.1  7.9  3.7 10.7  5.6
02/11/07 NE  6.9  8.4  0.3  1.7 -1.1 10.4  8.7  9.4  4.6
02/11/07 NW  6.4 10.4  4.8 13.8 -3.8 10.1  9.0  7.9 10.7
02/11/07 SC  3.9  2.6  3.2 12.6  2.1  4.7 -1.1 15.7  5.7
02/11/07 SE  8.1  0.1 -0.1  8.5  0.7  7.1  1.7  8.5  6.6
02/11/07 SW 11.9  6.7  2.9  4.2 -0.9 12.1  6.5 11.7  8.7
02/12/07 MW 34.6 15.9  1.8  1.0  4.5 10.2 14.0 19.1  4.9
02/12/07 NE 16.5  7.7  2.5  8.1  4.2 11.0 18.4  6.2  2.4
02/12/07 NW 23.9 15.8  3.6  9.4  8.1  9.2 11.2 14.1  2.1
02/12/07 SC 14.0 10.5  7.5  7.1  0.4 12.9  8.5 14.4  7.0
02/12/07 SE 13.8  6.5 -0.7  5.7  2.8 12.5 13.2  9.6  3.5
02/12/07 SW 19.7 14.1  0.7 13.4  9.6 13.5 11.4 12.5  3.6
02/13/07 MW 34.0 16.0  4.4  6.1 18.3  9.1 30.2 46.3 50.6
02/13/07 NE 21.2 10.2  5.6  1.1 18.7  9.2 35.0 49.7 35.9
02/13/07 NW 13.1 14.5  4.3 13.1 31.4  5.1 24.2 23.4 19.4
02/13/07 SC  9.0  4.5  3.6  6.8 17.9 12.0 21.7 16.6 16.8
02/13/07 SE 12.4  4.9  7.6  9.3 12.3  7.5 27.2 30.8 31.9
02/13/07 SW 20.6  2.7  2.9  5.0  9.9 13.3 17.5 12.8 18.8
02/14/07 MW 21.2 45.9 16.6 12.5 35.1 23.8 40.4 43.6 35.2
02/14/07 NE 22.5 30.0 26.1 14.2 41.5 46.2 43.6 75.5 34.1
02/14/07 NW 37.9 19.5 23.0 15.6 25.8 11.9 51.9 50.4 16.4
02/14/07 SC 18.9 20.6 20.3  5.2 14.1 18.7 24.3 44.8 26.2
02/14/07 SE 22.5 21.6 20.6  6.9 30.3 26.6 56.7 80.0 31.4
02/14/07 SW 21.5 29.5 19.9  8.5 51.4 30.1 29.2 29.3 23.1
02/15/07 MW 46.6 36.3 23.9 20.8 30.4 24.3 30.3 59.9 25.6
02/15/07 NE 62.7 60.4 39.5 27.6 44.9 27.9 51.5 64.7 38.2
02/15/07 NW 62.0 37.7 24.6 30.3 71.4 13.7 24.6 36.2 24.1
02/15/07 SC 28.9 27.8 13.5 22.2 31.1 19.8 30.4 38.4 18.0
02/15/07 SE 41.3 22.6 21.3 15.0 29.0 22.9 34.1 49.0 31.3
02/15/07 SW 40.7 34.9 28.6 16.2 36.1 23.4 29.3 32.7 21.6
02/16/07 MW 31.2 20.8 15.2 20.1  9.1 12.9 22.9 36.4 16.4
02/16/07 NE 31.3 41.4 23.1 40.2 19.3 19.7 28.3 40.4 17.3
02/16/07 NW 43.6 22.8 21.1 21.4 24.7 23.8 30.2 33.0 20.6
02/16/07 SC 19.3 21.9 24.5 24.6  5.1  8.5 24.9 42.9 23.2
02/16/07 SE 29.4 13.5 16.8 19.7 11.4 10.4 27.7 34.2 20.8
02/16/07 SW 28.1 18.4 17.1 25.5  8.0 15.2 30.4 26.6 20.8
;

proc mvpmodel data=flightDelays ncomp=3 noprint outloadings=mvpairloadings;
   var AA CO DL F9 FL NW UA US WN;
run;

data flightDelays2;
   label flightDate='Date';
   format flightDate MMDDYY8.;
   input flightDate :MMDDYY8. AA CO DL F9 FL NW UA US WN;
   datalines;
02/17/07 25.6  7.8 15.5 13.4 16.1 16.2 23.0 24.2  8.2
02/18/07  5.4 16.0  9.9  1.1 11.5 17.0 15.6 15.5  5.1
02/19/07 13.2 16.3 10.0 10.6  5.4 10.3  9.5 16.8  9.3
02/20/07  4.2  6.9  1.4  0.1  7.2  6.6  7.4 10.4  2.9
02/21/07  5.4 -0.1  7.4  8.7 16.3 24.3  9.4  6.0 10.2
02/22/07 19.6 30.2  6.8  2.7  8.9 16.4 14.3 12.6  8.2
02/23/07 14.9 18.9  9.9  9.1 12.0 16.5 17.4 12.8  6.0
02/24/07 21.4  5.5 11.1 46.1 10.6 55.3 22.9  8.8  3.4
02/25/07 42.6  7.7 14.6 14.4 32.0 50.7 46.1 49.4 39.1
02/26/07 43.2 25.1 18.1 18.2 28.8 31.1 38.6 29.6 18.6
02/27/07 11.3 17.1  5.3  4.1  4.8 13.9  9.8  9.7  7.1
02/28/07  8.1  3.7  2.7 17.1 -0.8  5.5 11.0 14.3  3.1
;

proc mvpmonitor data=flightDelays2 loadings=mvpairloadings;
   time flightDate;
   id flightDate;
   tsquarechart;
   spechart;
run;