libname CV4 'C:\Users\mithe\Škola\MV011 Statistika I --- výuka 2014\SAS'; /*ukol 1 */ /*options date pageno=1;*/ options nodate pageno=1; ods html file='C:\Users\mithe\Škola\MV011 Statistika I --- výuka 2014\SAS\cv4p1.html' style=sasweb; proc freq data=CV4.sales; tables Gender*Country; where Job_Title contains 'Rep'; title 'Sales Rep Frequency Report'; run; ods html close; /*ukol 2 */ data CV4.sales1; set CV4.sales; Hire_age=floor(intck('day',birth_date,hire_date)/365); run; proc freq data=CV4.sales1; /*vyrobi tabulku pro vsechny hodnoty hire_age...takze takto ne*/ tables hire_age; run; /*takto je to spravne */ proc format; value hireAge low-<20 = '1. pod 20' 20-<25 = '2. 20 - 25' 25-high ='3. nad 25'; run; proc freq data=CV4.sales1; tables hire_age; format hire_age hireAge. ; run; /*ukol 3 */ proc means data=CV4.sales1 mean range; var Salary; class Gender Country hire_age; format hire_age hireAge.; output out=work.means1; run; proc print data=work.means1; run; /*ukol 4 */ proc tabulate data=CV4.sales1; class Gender Country hire_age; table (hire_age all)*Country,gender*(n rowpctn colpctn) ; format hire_age hireAge.; run; /*ukol 5 */ ods pdf file='C:\Users\mithe\Škola\MV011 Statistika I --- výuka 2014\SAS\cv4p5.pdf' style=sasweb; proc tabulate data=CV4.sales1 missing; class Gender Country hire_age; var salary; table (hire_age all)*(country all), (gender all)*salary*(min p50 max) ; format hire_age hireAge.; run; ods pdf close; /*ukol 6 */ ods rtf file='C:\Users\mithe\Škola\MV011 Statistika I --- výuka 2014\SAS\cv4p6.rtf' style=sasweb; proc univariate data=CV4.sales; var Salary; run; ods rtf close;