libname CV4 'C:\Users\mithe\Škola\MV011 Statistika I --- výuka 2014\SAS'; /*ukol 1 */ /* priklady obrazku k proc gplot: http://support.sas.com/sassamples/graphgallery/PROC_GPLOT.html inspiraci pro resni ukolu 1 jsou: http://support.sas.com/kb/24/932.html http://support.sas.com/kb/25/584.html clanek o nastaveni parametru legendy: http://www2.sas.com/proceedings/forum2007/163-2007.pdf help k nastaveni parametru legendy: http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#legendchap.htm dokumentace k fonfum (vcetne seznamu fontu) v SAS/Graph http://www2.stat.unibo.it/manualisas/gref/c06.pdf */ /*pocatecni pokusy*/ goptions reset=all; proc gplot data=CV4.sales1; plot hire_age*birth_date; run; proc gplot data=CV4.sales1; plot hire_age*birth_date=gender; run; proc gplot data=CV4.sales1; plot hire_age*birth_date=gender; symbol1 value=dot interpol=r width=5 color=red; symbol2 value=dot interpol=r width=5 color=blue; run; proc gplot data=CV4.sales1; plot hire_age*birth_date=gender; plot2 hire_age*birth_date=gender; run; proc gplot data=CV4.sales1; plot hire_age*birth_date=gender; plot2 hire_age*birth_date=gender; symbol1 value=dot color=red; symbol2 value=dot color=blue; symbol3 value=none interpol=r width=5 color=red; symbol4 value=none interpol=r width=5 color=blue; run; /*spravne reseni */ goptions reset=all htitle=12pt; axis1 label=(f='arial/bo' h=12pt) value=(f='arial/bo' h=10pt); axis2 label=(a=90 f='arial/bo' h=12pt) value=(f='arial/bo' h=10pt); legend1 label=(color=black f='arial/bo' h=12pt position=top) position=(top right inside) mode=protect value=(f='arial/bo' h=10pt) frame origin=(73pct,90pct); legend2 label=(color=black f='arial/bo' h=10pt position=top 'Regression lines') position=(top right inside) frame mode=protect value=(f='arial/bo' h=10pt)origin=(73pct,81pct); proc gplot data=CV4.sales1; plot hire_age*birth_date=gender /haxis=axis1 vaxis=axis2 legend=legend1; plot2 hire_age*birth_date=gender /noaxis legend=legend2; title 'Relation of hire_age and birth_date'; symbol1 value=dot color=red; symbol2 value=dot color=blue; symbol3 value=none interpol=r width=5 color=red; symbol4 value=none interpol=r width=5 color=blue; format birth_date mmddyy10.; run; /*ukol 2 */ goptions reset=all; proc gplot data=sashelp.workers; plot (electric masonry)*date / overlay legend; run; /*spravne reseni*/ goptions reset=all htitle=12pt;; axis1 label=(f='arial/bo' h=12pt) value=(f='arial/bo' h=10pt); axis2 label=(a=90 f='arial/bo' h=12pt 'number of workers') value=(f='arial/bo' h=10pt); legend1 label=none position=(top left inside) mode=protect value=(f='arial/bo' h=10pt) frame offset=(1pct) across=1 down=2; proc gplot data=sashelp.workers; plot (electric masonry)*date / overlay haxis=axis1 vaxis=axis2 legend=legend1; title 'Number of workers'; symbol1 value=none color=red interpol=join w=5; symbol2 value=none color=blue interpol=join w=5; format date mmddyy10.; run;