View
221
Download
2
Category
Preview:
Citation preview
17 zhushw@em.tsinghua.edu.cn
PRINT TABULATE GPLOT GCHART
PRINT PRINTPRINT
PROC PRINT ; BY variable-1 ; PAGEBY BY-variable; SUMBY BY-variable; ID variable(s); SUM variable(s); VAR variable(s);
Sheet1
BY
ID
PAGEBY
SUMBY
SUM
VAR
Sheet2
Sheet3
PROC PRINT PROC PRINT ;
option(s)
Sheet1
DATA=
DOUBLE
NOOBS
OBS=
ROUND
ROWS=
WIDTH=
HEADING=V|H
LABEL
WIDTH=FULL|MIN|U
Sheet2
Sheet3
17.1
DATA=proc print data=fdata.class;proc print ;run;
DOUBLEproc print data=fdata.class double;var name age height;run;
N=proc print data=fdata.class n='';by sex;run;NOOBSproc print data=fdata.class noobs;run;
OBS=, LABEL SPLIT=
proc print data=fdata.a1a0001 (obs=10) label;var date clpr ;run;
proc print data=fdata.a1a0001 splite='*' n obs='**====' ;var date clpr ;label date='*==' clpr='close*price*=='; where year(date)=2000;run;
proc print data=fdata.a600001 (Where=(year(date)=2000)) split='*' n obs='**=====' ;var date clpr ;label date='date**=====' clpr='close price* *========'; run;
proc print data=fdata.class;var name age weight height;by sex;pageby sex;sumby sex;run;
proc print data=fdata.class split='#';var height;label height='This is a Label # for height';run;
proc print data=fdata.class (obs=3) noobs;var height weight;title2 '';id name;run;
proc print data=fdata.class ;id name;sum age height weight;run;
17.2 options nodate pageno=1 linesize=70 pagesize=60;proc print data=fdata.exprev double;var month state expenses;title 'Monthly Expenses for Offices in Each State';run;
17.3
options nodate pageno=1 linesize=70 pagesize=60;proc print data=fdata.exprev split='*' n obs='Observation*Number*===========';var month state expenses;label month='Month**=====' state='State**=====' expenses='Expenses**========'; format expenses comma10.;title 'Monthly Expenses for Offices in Each State';run;
17.4
options pagesize=60 pageno=1 nodate linesize=70;proc sort data=fdata.exprev;by region state month;run;
proc print data=fdata.exprev n='Number of observations for the state: ' noobs label;var month expenses revenues;by region state;pageby region;label region='Sales Region';format revenues expenses comma10.;title 'Sales Figures Grouped by Region and State';run;
17.5 BY
options nodate pageno=1 linesize=70 pagesize=60 nobyline;proc sort data=fdata.exprev;by region;run;
proc print data=fdata.exprev noobs n='Number of observations for the state: ';sum expenses revenues;by region;format revenues expenses comma10.;title 'Revenue and Expense Totals for the #byval(region) Region';run;options byline;
17.6 BY
options nodate pageno=1 linesize=70 pagesize=60;proc sort data=fdata.exprev;by region state;run;
proc print data=fdata.exprev n noobs; by region state;sum expenses revenues; label region='Sales Region';format revenues expenses comma10.;title 'Revenue and Expense Totals for Each State and Region';run;
17.7
options nodate pageno=1 linesize=70 pagesize=60;proc sort data=fdata.exprev;by region state;run;
proc print data=fdata.exprev noobs;by region state;sum revenues expenses;sumby region;label region='Sales Region';format revenues expenses comma10.;title 'Revenue and Expense Figures for Each Region';run;
17.8
options nodate pageno=1 linesize=64 pagesize=24 ;proc print data=fdata.empdata(obs=12);id idnumber;title 'Personnel Data';run;
proc print data=fdata.empdata(obs=12) rows=page;id idnumber;title 'Personnel Data';run;
17.9 BYID
options nodate pageno=1 linesize=64 pagesize=60;proc sort data=fdata.empdata out=tempemp;by jobcode gender;run;proc print data=tempemp split='*';id jobcode;by jobcode;var gender salary;sum salary;label jobcode='Job Code*========' gender='Gender*======' salary='Annual Salary*=============';format salary dollar11.2;where jobcode contains 'FA' or jobcode contains 'ME';title 'Expenses Incurred for';title2 'Salaries for Flight Attendants and Mechanics';run;
17.10 SASlibname printlib 'D:\fdata\printlib';options nodate pageno=1 linesize=80 pagesize=60;proc datasets library=fdata memtype=data nolist;copy out=printlib;select class fitness grad exprev;run;%macro printall(libname,worklib=work); %local num i; proc datasets library=&libname memtype=data nodetails; contents out=&worklib..temp1(keep=memname) data=_all_ noprint; run;data _null_; set &worklib..temp1 end=final; by memname notsorted; if last.memname; n+1;call symput('ds'||left(put(n,8.)),trim(memname)); if final then call symput('num',put(n,8.)); run;%do i=1 %to # proc print data=&libname..&&ds&i noobs; title "Data Set &libname..&&ds&i"; run; %end;%mend printall;options nodate pageno=1 linesize=70 pagesize=60;%printall(printlib) ;
TABULATE
PROC TABULATE ; BY variable-1 ; CLASS variable(s) ; CLASSLEV variable(s) / style = ; FREQ variable; KEYLABEL keyword-1='description-1' ; KEYWORD keyword(s) / style = ; TABLE column-expression ; VAR analysis-variable(s); WEIGHT variable;
Sheet1
BY
CLASS
CLASSLEV
FREQ
KEYLABEL
KEYWORD
TABLE
VAR
WEIGHT
Sheet2
Sheet3
TABLE TABLE column-expression ; PRINTTABULATETABULATETABLE TABLESAS
17.11proc format;value regfmt 1='Northeast' 2='South' 3='Midwest' 4='West';value divfmt 1='New England' 2='Middle Atlantic' 3='Mountain' 4='Pacific';value usetype 1='Residential Customers' 2='Business Customers';run;options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12.;class region division type;var expenditures;table region*division, type*expenditures / rts=25;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;
17.12 CLASS
options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12. classdata=fdata.classes exclusive;class region division type;var expenditures;table region*division, type*expenditures / rts=25;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;
17.13 CLASS
options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12.;class region division type / preloadfmt;var expenditures;table region*division, type*expenditures / rts=25 printmiss;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;proc tabulate data=fdata.energy format=dollar12. out=tabdata;class region division type / preloadfmt exclusive;var expenditures;table region*division, type*expenditures / rts=25;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;proc print data=tabdata;run;
17.14
options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12.;class region division type;var expenditures;table region*division, type='Customer Base'*expenditures=' '*sum=' ' / rts=25;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;
17.15 CLASSALL
options nodate pageno=1 linesize=64 pagesize=60;proc tabulate data=fdata.energy format=comma12.;class region division type;var expenditures;table region*(division all='Subtotal') all='Total for All Regions'*f=dollar12., type='Customer Base'*expenditures=' '*sum=' ' all='All Customers'*expenditures=' '*sum=' ' / rts=25;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;
17.16
options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12.;class region division type;var expenditures;table region*division*expenditures=' '*sum=' ', type='Customer Base' / rts=25 row=float;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;
17.17
options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12. noseps;class region division type;var expenditures;table region*division,type='Customer Base'*expenditures=' '*sum=' ' / rts=25 indent=4;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region';title2 '(millions of dollars)';run;
17.18
options nodate pageno=1 linesize=80 pagesize=60;proc tabulate data=fdata.energy format=dollar12.;class region division type;var expenditures;table region='Region: ' all='All Regions', division all='All Divisions', type='Customer Base'*expenditures=' '*sum=' ' / rts=25 box=_page_ condense indent=1;format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures for Each Region and All Regions';title2 '(millions of dollars)';run;
17.19
data _null_; if 0 then set fdata.customer_response nobs=count; call symput('num',left(put(count,4.))); stop;run;proc format;picture pctfmt low-high='009.9 %';run;proc tabulate data=fdata.customer_response;var factor1-factor4 customer;table factor1='Cost' factor2='Performance' factor3='Reliability' factor4='Sales Staff', (n='Count'*f=7. pctn='Percent'*f=pctfmt9.) ;title 'Customer Survey Results: Spring 1996';title3 'Factors Influencing the Decision to Buy';run;
/**/options nonumber;proc tabulate data=fdata.customer_response;var source1-source3 customer;table source1='TV/Radio' source2='Newspaper' source3='Word of Mouth', (n='Count'*f=7. pctn='Percent'*f=pctfmt9.) ;title 'Source of Company Name';footnote "Number of Respondents: &num";run;options formdlim=' ' number;run;
17.20
options nodate pageno=1 linesize=132 pagesize=40;proc format;value $timefmt 'Time1'='6-9 a.m.' 'Time2'='9 a.m. to noon' 'Time3'='noon to 1 p.m.' 'Time4'='1-4 p.m.' 'Time5'='4-6 p.m.' 'Time6'='6-10 p.m.' 'Time7'='10 p.m. to 2 a.m.' other='*** Data Entry Error ***';value $pgmfmt '0'="Don't Listen" '1','2'='Rock and Top 40' '3'='Country' '4','5','6'='Jazz, Classical, and Easy Listening' '7'='News/ Information /Talk' '8'='Other' other='*** Data Entry Error ***';run;
/**/proc transpose data=fdata.radio out=radio_transposed(rename=(col1=Choice)) name=Timespan;by listener;var time1-time7;format timespan $timefmt. choice $pgmfmt.;run; proc tabulate data=radio_transposed format=12.;class timespan choice;table timespan='Time of Day', choice='Choice of Radio Program'*n='Number of Listeners';title 'Listening Preferences on Weekdays';run;
17.21 options nodate pageno=1 linesize=105 pagesize=60; proc format;picture pctfmt low-high='009 %';run;title "Fundraiser Sales";
proc tabulate data=fdata. Fundrais format=7.;class team classrm;var sales;table (team all)*sales=' ', classrm='Classroom'*(sum colpctsum*f=pctfmt9. rowpctsum*f=pctfmt9. reppctsum*f=pctfmt9.) all /rts=20 row=float;run;
17.22
options nodate pageno=1 linesize=80 pagesize=60;proc format;value gendfmt 1='Female' 2='Male' other='*** Data Entry Error ***';value occupfmt 1='Technical' 2='Manager/Supervisor' 3='Clerical' 4='Administrative' other='*** Data Entry Error ***';run;proc tabulate data=fdata.jobclass format=8.2;class gender occupation;table (occupation='Job Class' all='All Jobs') *(n='Number of employees'*f=9. pctn='Percent of row total' pctn='Percent of column total' pctn='Percent of total'), gender='Gender' all='All Employees'/ rts=50;format gender gendfmt. occupation occupfmt.;title 'Gender Distribution';title2 'within Job Classes';run;
17.23 HTML
ods html body='d:\fdata\html.htm';proc tabulate data=fdata.energy style=[font_weight=bold];class region division type / style=[just=center];classlev region division type / style=[just=left];var expenditures / style=[font_size=3];keyword all sum / style=[font_width=wide];keylabel all="Total";table (region all)*(division all*[style=[background=yellow]]), (type all)*(expenditures*f=dollar10.) / style=[background=red] misstext=[label="Missing" style=[font_weight=light]] box=[label="Region by Division by Type" style=[font_style=italic]];format region regfmt. division divfmt. type usetype.;title 'Energy Expenditures';title2 '(millions of dollars)';run;ods html close;run;
SAS/GRAPHSAS/GRAPH (PLOTS) (CHARTS) (MAPS) (3D GRAPHICS) (TEXT SLIDES)
GPLOTGCHARTGPLOT
PROC GPLOT ; BUBBLE plot-request(s) ; BUBBLE2 plot-request(s) ; PLOT plot-request(s) ; PLOT2 plot-request(s) ;
PLOT PLOT () ()
Sheet1
HAXIS=
VAXIS=
HMINOR=
VMINOR=
Sheet2
Sheet3
SYMBOL SYMBOL
Sheet1
V=
H=
I=
FONT=
L=
COLOR=
Sheet2
Sheet3
AXIS AXIS
Sheet1
LABEL=
ANGLE=
ORDER=
R=
Sheet2
Sheet3
17.24 Bubblegoptions reset=global gunit=pct border cback=white colors=(black blue green red) ftitle=swissb ftext=swiss htitle=6 htext=4;title1 'Member Profile';title2 'Salaries and Number of Member Engineers';footnote h=3 j=r 'GR21N01 ';axis1 offset=(5,5);proc gplot data=fdata.jobs;format dollars dollar9.;bubble dollars*eng=num / haxis=axis1;run;quit;
17.25
goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftitle=swissb ftext=swiss htitle=6 htext=4;title1 'Member Profile';title2 h=4 'Salaries and Number of Member Engineers';footnote1 h=3 j=r 'GR21N02 ';axis1 label=noneoffset=(5,5)width=3value=(height=4);axis2 order=(0 to 40000 by 10000) label=none major=(height=1.5) minor=(height=1) width=3 value=(height=4);
/**/ proc gplot data=fdata.jobs; format dollars dollar9. num comma7.0; bubble dollars*eng=num / haxis=axis1 vaxis=axis2 vminor=1 bcolor=red blabel bfont=swissi bsize=12 caxis=blue;run;quit;
17.26 goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftitle=swissb ftext=swiss htitle=6 htext=3;data fdata.jobs2; set fdata.jobs; yen=dollars*125;run;title1 'Member Profile';title2 h=4 'Salaries and Number of Member Engineers';footnote j=r 'GR21N03 ';axis1 offset=(5,5) label=none width=3 value=(h=4);
/**/proc gplot data=fdata.jobs2;format dollars dollar7. num yen comma9.0;bubble dollars*eng=num / haxis=axis1 vaxis=10000 to 40000 by 10000 hminor=0 vminor=1 blabel bfont=swissi bcolor=red bsize=12 caxis=blue;bubble2 yen*eng=num / vaxis=1250000 to 5000000 by 1250000 vminor=1 bcolor=red bsize=12 caxis=blue;run;quit;
17.27
goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftitle=swissb ftext=swiss htitle=6 htext=4;title1 'Dow Jones Yearly Highs';footnote1 h=3 j=l ' Source: 1997 World Almanac'j=r 'GR21N05 ';symbol1 color=red interpol=join value=dot height=3;proc gplot data=fdata.djia;plot high*year / haxis=1955 to 1995 by 5 vaxis=0 to 6000 by 1000 hminor=3 vminor=1 vref=1000 3000 5000 lvref=2 cvref=blue caxis=blue ctext=red;run;quit;
17.28
goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftitle=swissb ftext=swiss htitle=6 htext=4; title1 'Dow Jones Yearly Highs and Lows';footnote1 h=3 j=l ' Source: 1997 World Almanac' j=r 'GR21N06 ';symbol1 color=red interpol=join value=dot height=3;symbol2 font=marker value=C color=blue interpol=join height=2;
/**/axis1 order=(1955 to 1995 by 5) offset=(2,2) label=none major=(height=2) minor=(height=1) width=3;axis2 order=(0 to 6000 by 1000) offset=(0,0) label=none major=(height=2) minor=(height=1) width=3;legend1 label=none shape=symbol(4,2) position=(top center inside) mode=share;proc gplot data=fdata.djia;plot high*year low*year / overlay legend=legend1 vref=1000 to 5000 by 1000 lvref=2 haxis=axis1 hminor=4 vaxis=axis2 vminor=1;run;quit;
17.29 goptions reset=global gunit=pct border cback=white colors=(blue red) ctext=black ftitle=swissb ftext=swiss htitle=6 htext=4; title1 'Dow Jones Yearly Highs and Lows';footnote1 h=3 j=l ' Source: 1997 World Almanac' j=r 'GR21N07 '; symbol1 interpol=join; axis1 order=(1955 to 1995 by 5) offset=(2,2) label=none major=(height=2) minor=(height=1);axis2 order=(0 to 6000 by 1000) offset=(0,0) label=none major=(height=2) minor=(height=1);
/**/proc gplot data=fdata.djia; plot low*year high*year / overlay haxis=axis1 hminor=4 vaxis=axis2 vminor=1 caxis=black areas=2;run;quit;
17.30
goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftitle=swissb ftext=swiss htitle=6 htext=3;title1 'Average Monthly Temperature for Minneapolis';footnote1 j=l ' Source: 1984 American Express';footnote2 j=l ' Appointment Book' j=r 'GR21N09 ';symbol1 interpol=needle ci=blue cv=red width=3 value=star height=3;symbol2 interpol=none value=none;axis1 label=none value=('JAN' 'FEB' 'MAR' 'APR' 'MAY' 'JUN' 'JUL' 'AUG' 'SEP' 'OCT' 'NOV' 'DEC') offset=(2) width=3;
/**/axis2 label=('Degrees' justify=right ' Centigrade') order=(-20 to 30 by 10) width=3;axis3 label=(h=3 'Degrees' justify=left 'Fahrenheit') order=(-4 to 86 by 18) width=3; proc gplot data=fdata.minntemp; plot c2*month / caxis=red haxis=axis1 hminor=0 vaxis=axis2 vminor=1plot2 f2*month / caxis=red vaxis=axis3 vminor=1;run;quit;
17.31 filename odsout 'd:/fdata';ods listing close;goptions reset=global gunit=pct colors=(black red blue green) ftext=swiss ftitle=swissb htitle=6 htext=3 device=gif transparency noborder;data newtemp;set fdata.citytemp;length citydrill $ 40; if city='Minn' then citydrill='HREF="city_reports.html#IDX1"'; else if city='Phoenix' then citydrill='HREF="city_reports.html#IDX2"'; else if city='Raleigh' then citydrill='HREF="city_reports.html#IDX3"';title1 'Average Monthly Temperature';footnote1 j=l h=3 ' Click a data point or legend symbol ' j=r 'GR21N10 ';symbol1 interpol=join value=dot height=3;
/**/ods html path=odsout body='city_plots.html' nogtitle; proc gplot data=newtemp; plot fahrenheit*month=city / hminor=0 html=citydrill html_legend=citydrill;run;quit;ods html path=odsout body='city_reports.html'; proc sort data=newtemp; by city month;run;
/**/goptions reset=footnote;option nobyline;
title1 'Monthly Temperatures in #byval(city)';proc report data=newtemp nowindows; by city; column city month fahrenheit;define city / noprint group;define month / display group; define Fahrenheit / display group;run; ods html close;ods listing;
17.32
proc reg data=fdata.r_month;model r_600603=r_m / dw spec;output out=out1 r=r p=p l95=l u95=u; slope:test r_m=1;title2 '';run;
goptions reset=global gunit=pct cback=white borderhtitle=6 htext=3 ftext=swissb colors=(black);goptions reset=symbol;
proc sort data=out1 out=r_out ; by r_m;run;
/**/data regdata(keep=y_value pt_type r_m); set r_out; label pt_type='Observation Type'; array regvar(4) r_600603 p l u; array varlabel(4) $12. _temporary_ ('Actual' 'Predicted' 'Lower Limits' 'Upper Limits'); do i=1 to 4;y_value=regvar(i);pt_type=varlabel(i); output; end;run;
/**/proc gplot data=regdata; plot y_value*r_m=pt_type / haxis=axis1 vaxis=axis2 hminor=4 vminor=4; symbol1 v=* h=3.5 pct font=swissb color=black r=1; symbol2 i=join font=swissb l=1 color=blue r=1; symbol3 i=join font=swissb l=1 color=green r=1; symbol4 i=join font=swissb l=1 color=red r=1; axis1 order=(-.3 to .15 by .05); axis2 label=(angle=90 'r_600603') order=(-.5 to .5 by .25); title f=HWDMX001 ''; title2 f=HWDMX001 '';run;quit;
GCHARTGCHART
PROC GCHART BLOCK chart-variable(s) HBAR | HBAR3D | VBAR | VBAR3Dchart-variable(s) PIE | PIE3D | DONUT chart-variable(s) STAR chart-variable(s) GCHART
GCHART
Sheet1
HBAR
HBAR3D
VBAR
VBAR3D
BLOCK
PIE
PIE3D
STAR
Sheet2
Sheet3
(chart-variable)GCHART
Sheet1
Sheet2
Sheet3
GCHARTGCHART()GCHART
Sheet1
LEVEL=N
DISCRETE
ASCENDING
DESCENDING
Sheet2
Sheet3
17.33
vbar sales / levels=10;vbar sales / 1000 to10000 by 1000;vbar year / discrete;hbar city / mindpoint=BJ SH GZ;hbar city / ascending;
SUMVAR= TYPE=FREQ|CFREQ|PERCENT|CPERCENT|MEAN|SUMFREQ,SUMMEANSUM
17.34 hbar city / sumvar=sales type=mean;
17.35 goptions reset=global gunit=pct border cback=white ctext=black colors=(blue green red) ftext=swiss ftitle=swissb htitle=6 htext=3.5;title 'Total Sales';footnote j=r 'GR13N01';proc gchart data=fdata.totals;format sales dollar8.;block site / sumvar=sales;run;quit;
17.36
goptions reset=global gunit=pct border cback=white colors=(blue green red) ctext=blackftitle=swissb ftext=swiss htitle=4 htext=3;title 'Average Sales by Department';footnote j=r 'GR13N02 ';legend1 cborder=black label=('Quarter:') position=(middle left outside) mode=protect across=1;
/**/proc gchart data=fdata.totals;format quarter roman.;format sales dollar8.;label site='00'x dept='00'x;block site / sumvar=sales type=mean midpoints='Sydney' 'Atlanta' group=dept subgroup=quarter legend=legend1 noheading coutline=black caxis=black;run;quit;
17.37 goptions reset=global gunit=pct border colors=(black red blue green) cback=white ftitle=swissb ftext=swiss htitle=6 htext=3.5;title1 'Total Sales';footnote1 h=3 j=r 'GR13N03(a) ';pattern1 color=red;proc gchart data=fdata.totals;format sales dollar8.;hbar site / sumvar=sales;run;footnote1 h=3 j=r 'GR13N03(b) ';vbar3d site / sumvar=sales coutline=black;run;quit;
17.38 3D goptions reset=global gunit=pct border cback=white colors=(black red green blue) ftitle=swissb ftext=swiss htitle=6 htext=4 offshadow=(1.5,1.5);title1 'Total Sales by Site';footnote1 h=3 j=r 'GR13N04 ';axis1 label=none origin=(24,);axis2 label=none order=(0 to 100000 by 20000) minor=(number=1) offset=(,0);legend1 label=none shape=bar(3,3) cborder=black cblock=gray origin=(24,);pattern1 color=lipk;pattern2 color=cyan;pattern3 color=lime;
/**/proc gchart data=reflib.totals;format quarter roman.;format sales dollar8.;vbar3d site / sumvar=sales subgroup=dept inside=subpct outside=sum width=9 space=4 maxis=axis1 raxis=axis2 cframe=gray coutline=black legend=legend1;run;quit;
17.39
goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftext=swiss ftitle=swissb htitle=6 htext=3.5;title1 'Fitness Program Participants';footnote h=3 j=r 'GR13N05(a) ';axis1 label=('Number of People') minor=(number=1) offset=(0,0);legend1 label=none value=('Women' 'Men');pattern1 color=cyan;pattern2 color=blue;
proc gchart data=fdata.fitness;hbar age / subgroup=group legend=legend1 autoref clipref coutline=black raxis=axis1;run;footnote h=3 j=r 'GR13N05(b) ';axis1 order=(0 to 20 by 2) label=('Number of People') minor=(number=1) offset=(0,0);axis2 label=('Age ' j=r 'Group');hbar3d age / midpoints=(20 30 40 50) freq freqlabel='Total in Group' subgroup=group autoref maxis=axis2 raxis=axis1 legend=legend1 coutline=black;run;quit;
17.40 goptions reset=global gunit=pct border cback=white colors=(blue green red) ctext=black ftitle=swissb ftext=swiss htitle=6 htext=4;title 'Total Sales';footnote j=r 'GR13N08(a) ';proc gchart data=fdata.totals;format sales dollar8.;pie site / sumvar=sales coutline=black;run;footnote j=r 'GR13N08(b) ';pie3d site / sumvar=sales coutline=black explode='Paris';run;quit;
17.41 goptions reset=global gunit=pct border cback=white colors=(blue green red) ctext=black ftext=swissb ftext=swiss htitle=6 htext=4;title 'Sales by Site and Department';footnote h=3 j=r 'GR13N09 ';legend1 label=none shape=bar(4,4) position=(middle left) offset=(5,) across=1 mode=share;proc gchart data=fdata.totals;format sales dollar8.;donut site / sumvar=sales subgroup=dept donutpct=30 label=('All' justify=center 'Quarters') noheading legend=legend1 coutline=black ctext=black;run;quit;
17.42 goptions reset=global gunit=pct border cback=white colors=(black blue green red cyan lime gray) ftext=swiss ftitle=swissb htitle=6 htext=4;title 'Sources of Energy, 1995';footnote h=3 j=r 'GR13N10 ';proc gchart data=fdata.enprod (where=(year=1995));pie engytype / sumvar=produced other=0 midpoints='Coal' 'Geotherm' 'Petro' 'Biofuels' 'Gas' 'Nuclear' 'Hydro' value=none percent=arrow slice=arrow cfill=cyan noheading;run;quit;
Recommended