/* Reading in yearly earthquake data */ /* Keeping track of cumulative numbers through each year */ data quakes; input entry year number_quakes; drop entry; /* Tracking the smallest yearly number of quakes */ retain cumul_min; cumul_min = min(cumul_min, number_quakes); /* Tracking the largest yearly number of quakes */ retain cumul_max; cumul_max = max(cumul_max, number_quakes); /* Using the sum statement to track the cumulative total */ cumul_quakes + number_quakes; /* tracking the cumulative average */ cumul_mean = cumul_quakes/_n_; datalines; 1 1900 13 2 1901 14 3 1902 8 4 1903 10 5 1904 16 6 1905 26 7 1906 32 8 1907 27 9 1908 18 10 1909 32 11 1910 36 12 1911 24 13 1912 22 14 1913 23 15 1914 22 16 1915 18 17 1916 25 18 1917 21 19 1918 21 20 1919 14 21 1920 8 22 1921 11 23 1922 14 24 1923 23 25 1924 18 26 1925 17 27 1926 19 28 1927 20 29 1928 22 30 1929 19 31 1930 13 32 1931 26 33 1932 13 34 1933 14 35 1934 22 36 1935 24 37 1936 21 38 1937 22 39 1938 26 40 1939 21 41 1940 23 42 1941 24 43 1942 27 44 1943 41 45 1944 31 46 1945 27 47 1946 35 48 1947 26 49 1948 28 50 1949 36 51 1950 39 52 1951 21 53 1952 17 54 1953 22 55 1954 17 56 1955 19 57 1956 15 58 1957 34 59 1958 10 60 1959 15 61 1960 22 62 1961 18 63 1962 15 64 1963 20 65 1964 15 66 1965 22 67 1966 19 68 1967 16 69 1968 30 70 1969 27 71 1970 29 72 1971 23 73 1972 20 74 1973 16 75 1974 21 76 1975 21 77 1976 25 78 1977 16 79 1978 18 80 1979 15 81 1980 18 82 1981 14 83 1982 10 84 1983 15 85 1984 8 86 1985 15 87 1986 6 88 1987 11 89 1988 8 90 1989 7 91 1990 18 92 1991 16 93 1992 13 94 1993 12 95 1994 13 96 1995 20 97 1996 15 98 1997 16 99 1998 12 100 1999 18 101 2000 15 102 2001 16 103 2002 13 104 2003 15 105 2004 15 ; proc print data=quakes; title 'Earthquake data by year'; run;