next up previous
Next: Transformation d'une serie temporelle Up: TP1 : Manipulation des Previous: TP1 : Manipulation des

Définition et graphique

  1. Définir une serie temporelle (USCPI) (U.S. Consumer Price Index for Jun 1990 through July 1991 suivante
     
       1990  6 129.9 
       1990  7 130.4 
       1990  8 131.6 
       1990  9 132.7 
       1990 10 133.5 
       1990 11 133.8 
       1990 12 133.8 
       1991  1 134.6 
       1991  2 134.8 
       1991  3 135.0 
       1991  4 135.2 
       1991  5 135.6 
       1991  6 136.0 
       1991  7 136.2 
       ;
    

    Corrigé

     
    data uscpi; 
        input year month cpi; 
       datalines; 
       1990  6 129.9 
       1990  7 130.4 
       1990  8 131.6 
       1990  9 132.7 
       1990 10 133.5 
       1990 11 133.8 
       1990 12 133.8 
       1991  1 134.6 
       1991  2 134.8 
       1991  3 135.0 
       1991  4 135.2 
       1991  5 135.6 
       1991  6 136.0 
       1991  7 136.2 
       ; 
        
       proc print data=uscpi; 
       run;
    
  2. Tracer graphiquement cette série.

    Corrigé

     
       proc gplot data=uscpi; 
          symbol i=spline v=circle h=2; 
          plot cpi * date; 
       run;
    

  3. un tableau un peu plus grand : Soit un tableau de 5 colonnes

     
    data djia;
          input Year @7 HighDate date7. High @24 LowDate date7. Low;
          format highdate lowdate date7.;
          datalines;
    1954  31DEC54  404.39  11JAN54  279.87
    1955  30DEC55  488.40  17JAN55  388.20
    1956  06APR56  521.05  23JAN56  462.35
    1957  12JUL57  520.77  22OCT57  419.79
    1958  31DEC58  583.65  25FEB58  436.89
    1959  31DEC59  679.36  09FEB59  574.46
    1960  05JAN60  685.47  25OCT60  568.05
    1961  13DEC61  734.91  03JAN61  610.25
    1962  03JAN62  726.01  26JUN62  535.76
    1963  18DEC63  767.21  02JAN63  646.79
    1964  18NOV64  891.71  02JAN64  768.08
    1965  31DEC65  969.26  28JUN65  840.59
    1966  09FEB66  995.15  07OCT66  744.32
    1967  25SEP67  943.08  03JAN67  786.41
    1968  03DEC68  985.21  21MAR68  825.13
    1969  14MAY69  968.85  17DEC69  769.93
    1970  29DEC70  842.00  06MAY70  631.16
    1971  28APR71  950.82  23NOV71  797.97
    1972  11DEC72 1036.27  26JAN72  889.15
    1973  11JAN73 1051.70  05DEC73  788.31
    1974  13MAR74  891.66  06DEC74  577.60
    1975  15JUL75  881.81  02JAN75  632.04
    1976  21SEP76 1014.79  02JAN76  858.71
    1977  03JAN77  999.75  02NOV77  800.85
    1978  08SEP78  907.74  28FEB78  742.12
    1979  05OCT79  897.61  07NOV79  796.67
    1980  20NOV80 1000.17  21APR80  759.13
    1981  27APR81 1024.05  25SEP81  824.01
    1982  27DEC82 1070.55  12AUG82  776.92
    1983  29NOV83 1287.20  03JAN83 1027.04
    1984  06JAN84 1286.64  24JUL84 1086.57
    1985  16DEC85 1553.10  04JAN85 1184.96
    1986  02DEC86 1955.57  22JAN86 1502.29
    1987  25AUG87 2722.42  19OCT87 1738.74
    1988  21OCT88 2183.50  20JAN88 1879.14
    1989  09OCT89 2791.41  03JAN89 2144.64
    1990  16JUL90 2999.75  11OCT90 2365.10
    1991  31DEC91 3168.83  09JAN91 2470.30
    1992  01JUN92 3413.21  09OCT92 3136.58
    1993  29DEC93 3794.33  20JAN93 3241.95
    1994  31JAN94 3978.36  04APR94 3593.35
    ;
    

    1. Tracer la colonne 3 par rapport a annee.
    2. Tracer la colonne 3 tous les 5 années
    3. Tracer la colonne 3 et 5 en superposé
    4. Tracer dans la meme page trois courbes : la colonne 3, la colonne 4 et leur superposé

    Corrigé

     
    
    options nodate number pageno=1 linesize=80 pagesize=35;
    
       proc plot data=djia;
         plot high*year='*';
         title 'High Values of the Dow Jones Industrial Average';
       title2 'from 1954 to 1994';
    run;
    
    proc plot data=djia;
       plot high*year='*'
    	/ haxis=1950 to 1995 by 5;
       title 'High Values of Dow Jones Industrial Average';
       title2 'from 1954 to 1994';
    run;
    
    proc plot data=djia;
       plot high*year='*'
            low*year='o' / overlay box;
    
       title 'Plot of Highs and Lows';
       title2 'for the Dow Jones Industrial Average';
    run;
    
    options nodate pageno=1 linesize=120 pagesize=60;
    
    proc plot data=djia vpercent=50 hpercent=50;
       plot high*year='*';
       plot low*year='o';
       plot high*year='*' low*year='o' / overlay box;
       title 'Plots of the Dow Jones Industrial Average';
       title2 'from 1954 to 1994';
    run;
    

  4. La suite suivante donne le nombre d'appel d'urgent d'une ville

     
    data emergency_calls;
       input Date : date7. Calls @@;
       label calls='Number of Calls';
       datalines;
    1APR94 134   11APR94 384  13FEB94 488
    2MAR94 289   21MAR94 201  14MAR94 460
    3JUN94 184   13JUN94 152  30APR94 356
    4JAN94 179   14JAN94 128  16JUN94 480
    5APR94 360   15APR94 350  24JUL94 388
    6MAY94 245   15DEC94 150  17NOV94 328
    7JUL94 280   16MAY94 240  25AUG94 280
    8AUG94 494   17JUL94 499  26SEP94 394
    9SEP94 309   18AUG94 248  23NOV94 590
    19SEP94 356  24FEB94 201  29JUL94 330
    10OCT94 222  25MAR94 183  30AUG94 321
    11NOV94 294  26APR94 412   2DEC94 511
    27MAY94 294  22DEC94 413  28JUN94 309
    ;
    

    Tracer cette courbe de 1 Jan 94 au 1 Jan 95 en notant en axe les 1 du chaque mois

    Corrigé

     
    
    options nodate pageno=1 linesize=120 pagesize=40;
    proc plot data=emergency_calls;
       plot calls*date / haxis='1JAN94'd to '1JAN95'd by month;
       format date date7.;
       title 'Calls to City Emergency Services Number';
       title2 'Sample of Days for 1994';
    run;
    


next up previous
Next: Transformation d'une serie temporelle Up: TP1 : Manipulation des Previous: TP1 : Manipulation des
Huilong Zhang 2009-12-16