그래프의 이용
PROC MEANS DATA=ex.body;
RUN;
DATA ex.body1;
SET ex.body;
IF age<30 THEN age1="20대";
IF 30<=age<40 THEN age1="30대";
IF 40<=age<50 THEN age1="40대";
IF 50<=age THEN age1="50대";
RUN;
막대/파이그래프
TITLE 'Horizontal Bar Chart with Discrete';
PROC GCHART DATA=ex.body1;
HBAR age1 / DISCRETE;
RUN;
TITLE 'Pie Chart with Discrete';
PROC GCHART DATA=ex.body1;
PIE age1/ DISCRETE VALUE=INSIDE
PERCENT=INSIDE SLICE=OUTSIDE;
RUN; QUIT;
BOXPLOT 프로시저
PROC FORMAT;
VALUE gend 1='Male' 2='Female';
RUN;
FOOTNOTE;
PROC BOXPLOT DATA=ex.body;
PLOT age*gender / BOXSTYLE=schematic BOXWIDTH=20 HOFFSET=15;
FORMAT gender gend.;
RUN;
UNIVARIATE 프로시저
TITLE 'Use of PROC UNIVARIATE';
PROC UNIVARIATE DATA=ex.cars NORMAL PLOT;
VAR mpg;
RUN;
Line Graph (Time PLOT)
DATA Mriver;
INPUT year discharge @@;
CARDS;
1954 290 1955 420 1956 390 1957 610 1958 550 1959 440 1960 470
1961 600 1962 550 1963 360 1964 390 1965 500 1966 410 1967 460
1968 510 1969 560 1970 540 1971 480 1972 600 1973 880 1974 710
1975 670 1976 420 1977 430 1978 560 1979 800 1980 500 1981 420
1982 640 1983 770 1984 710 1985 680 1986 600 1987 450 1988 420
1989 630 1990 680 1991 700 1992 510 1993 900 1994 640 1995 590
1996 670 1997 680 1998 690 1999 580 2000 390 2001 580
;
RUN;
TITLE "Mississippi River discharge";
SYMBOL1 INTERPOL=join VALUE=dot;
AXIS1 ORDER=200 TO 1000 BY 100;
PROC GPLOT DATA=Mriver;
PLOT discharge*year/VAXIS=axis1;
RUN ; QUIT;
PROC SGPLOT DATA=Mriver;
SERIES X=year Y=discharge /MARKERS;
RUN;
'STATISTICS > SAS' 카테고리의 다른 글
Code _ Linear Regression (0) | 2020.03.09 |
---|---|
비교분석 코드 예제 (0) | 2020.03.06 |
SAS Basic (0) | 2020.03.05 |