Plotting the Relationship between Variables |
The examples in this section use one input file(footnote 1) and one SAS data set. The input file contains information about the high and low values of the Dow Jones Industrial Average from 1954 to 1998. The input file has the following structure:
1954 31DEC1954 404.39 11JAN1954 279.87 1955 30DEC1955 488.40 17JAN1955 388.20 1956 06APR1956 521.05 23JAN1956 462.35 1957 12JUL1957 520.77 22OCT1957 419.79 1958 31DEC1958 583.65 25FEB1958 436.89 ...more data lines... 1995 13DEC1995 5216.47 30JAN1995 3832.08 1996 27DEC1996 6560.91 10JAN1996 5032.94 1997 06AUG1997 8259.31 11APR1997 6391.69 1998 23NOV1998 9374.27 31AUG1998 7539.07
The input file contains the following values from left to right:
the date of the yearly high for the Dow Jones Industrial Average
the date of the yearly low for the Dow Jones Industrial Average
The following program creates the SAS data set HIGHLOW:
options pagesize=60 linesize=80 pageno=1 nodate; data highlow; infile 'your-input-file'; input Year @7 DateOfHigh date9. DowJonesHigh @28 DateOfLow date9. DowJonesLow; format LogDowHigh LogDowLow 5.2 DateOfHigh DateOfLow date9.; LogDowHigh=log(DowJonesHigh); LogDowLow=log(DowJonesLow); run;
The computed variables LogDowHigh and LogDowLow contain the log transformation of the yearly high and low values for the Dow Jones Industrial Average.
proc print data=highlow; title 'Dow Jones Industrial Average Yearly High and Low Values'; run;
A Listing of the HIGHLOW Data Set
Dow Jones Industrial Average Yearly High and Low Values 1 Dow Log DateOf Jones Dow Dow Log Obs Year High High DateOfLow JonesLow High DowLow 1 1954 31DEC1954 404.39 11JAN1954 279.87 6.00 5.63 2 1955 30DEC1955 488.40 17JAN1955 388.20 6.19 5.96 3 1956 06APR1956 521.05 23JAN1956 462.35 6.26 6.14 4 1957 12JUL1957 520.77 22OCT1957 419.79 6.26 6.04 5 1958 31DEC1958 583.65 25FEB1958 436.89 6.37 6.08 6 1959 31DEC1959 679.36 09FEB1959 574.46 6.52 6.35 7 1960 05JAN1960 685.47 25OCT1960 568.05 6.53 6.34 8 1961 13DEC1961 734.91 03JAN1961 610.25 6.60 6.41 9 1962 03JAN1962 726.01 26JUN1962 535.76 6.59 6.28 10 1963 18DEC1963 767.21 02JAN1963 646.79 6.64 6.47 11 1964 18NOV1964 891.71 02JAN1964 768.08 6.79 6.64 12 1965 31DEC1965 969.26 28JUN1965 840.59 6.88 6.73 13 1966 09FEB1966 995.15 07OCT1966 744.32 6.90 6.61 14 1967 25SEP1967 943.08 03JAN1967 786.41 6.85 6.67 15 1968 03DEC1968 985.21 21MAR1968 825.13 6.89 6.72 16 1969 14MAY1969 968.85 17DEC1969 769.93 6.88 6.65 17 1970 29DEC1970 842.00 06MAY1970 631.16 6.74 6.45 18 1971 28APR1971 950.82 23NOV1971 797.97 6.86 6.68 19 1972 11DEC1972 1036.27 26JAN1972 889.15 6.94 6.79 20 1973 11JAN1973 1051.70 05DEC1973 788.31 6.96 6.67 21 1974 13MAR1974 891.66 06DEC1974 577.60 6.79 6.36 22 1975 15JUL1975 881.81 02JAN1975 632.04 6.78 6.45 23 1976 21SEP1976 1014.79 02JAN1976 858.71 6.92 6.76 24 1977 03JAN1977 999.75 02NOV1977 800.85 6.91 6.69 25 1978 08SEP1978 907.74 28FEB1978 742.12 6.81 6.61 26 1979 05OCT1979 897.61 07NOV1979 796.67 6.80 6.68 27 1980 20NOV1980 1000.17 21APR1980 759.13 6.91 6.63 28 1981 27APR1981 1024.05 25SEP1981 824.01 6.93 6.71 29 1982 27DEC1982 1070.55 12AUG1982 776.92 6.98 6.66 30 1983 29NOV1983 1287.20 03JAN1983 1027.04 7.16 6.93 31 1984 06JAN1984 1286.64 24JUL1984 1086.57 7.16 6.99 32 1985 16DEC1985 1553.10 04JAN1985 1184.96 7.35 7.08 33 1986 02DEC1986 1955.57 22JAN1986 1502.29 7.58 7.31 34 1987 25AUG1987 2722.42 19OCT1987 1738.74 7.91 7.46 35 1988 21OCT1988 2183.50 20JAN1988 1879.14 7.69 7.54 36 1989 09OCT1989 2791.41 03JAN1989 2144.64 7.93 7.67 37 1990 16JUL1990 2999.75 11OCT1990 2365.10 8.01 7.77 38 1991 31DEC1991 3168.83 09JAN1991 2470.30 8.06 7.81 39 1992 01JUN1992 3413.21 09OCT1992 3136.58 8.14 8.05 40 1993 29DEC1993 3794.33 20JAN1993 3241.95 8.24 8.08 41 1994 31JAN1994 3978.36 04APR1994 3593.35 8.29 8.19 42 1995 13DEC1995 5216.47 30JAN1995 3832.08 8.56 8.25 43 1996 27DEC1996 6560.91 10JAN1996 5032.94 8.79 8.52 44 1997 06AUG1997 8259.31 11APR1997 6391.69 9.02 8.76 45 1998 23NOV1998 9374.27 31AUG1998 7539.07 9.15 8.93
Note: All graphics output in this section uses an OPTIONS statement that specifies PAGESIZE=40 and LINESIZE=76. When the PAGESIZE= and LINESIZE= options are set, they remain in effect until you reset the options with another OPTIONS statement, or you end the SAS session.
FOOTNOTE 1: Refer to Additional Data Sets for a complete listing of the input data.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.