libname ref "/folders/myfolders"; /* Importing excel file */ proc import datafile ="/folders/myfolders/DataSet1.xlsx" out= ref.dataset1 DBMS=XLSX replace; sheet='Employee-Attrition'; getnames = yes; run; /* Importing csv file */ proc import datafile ="/folders/myfolders/CSVData.csv" out= ref.csvdata DBMS=csv replace; getnames = yes; run; /* 1. High paying specialization in terms of daily rate? */ proc means data=ref.dataset1 sum; var DailyRate; class education; run; No.3 i.e. Bachelor /* 2. High paying specialization by degree */ proc means data=ref.dataset1 sum; var DailyRate; class EducationField ; run; /* Lifesciences */ proc means data=ref.dataset1 sum; var DailyRate; class EducationField education ; run; /* Bachelor degree in life sciences */ /*Frequency Distribution */ proc format; value agefrmt 0 - <25='Less than 25' 25 - 34='25 -34' 35 - 41='35 -41' 42 - 50='42 -50' 51 - high='51 and above'; run; /*Which age group employees has attrited most */ proc freq data = ref.dataset1; tables age * Attrition / nopercent nocol nocum norow; format age agefrmt.; run; /* 25 -34 */ Which age group has least traveled? proc freq data=ref.dataset1; tables age*BusinessTravel/ nopercent nocol nocum norow; format age agefrmt.; run; /* less than 25 */ /* People who made frequent switches in the past generally leave an */ /* organization early */ proc freq data=ref.dataset1; tables age*NumCompaniesWorked/ norow nocol nopercent nocum; format age agefrmt.; run; proc freq data = ref.dataset1; tables age * Attrition / nopercent nocol nocum norow; format age agefrmt.; run; /* 25 -34 */ /* Which department has highest level of job satisfaction? */ proc format; value jsfrmt 1 ='Low' 2 ='Medium' 3 ='High' 4 ='Very High'; run; proc freq data=ref.dataset1; tables Department*JobSatisfaction/ norow nocum nocol; format JobSatisfaction jsfrmt.; run; /* Research & Development */