libname herc 'S:\Courses\stat-renaes\Stat404'; * Creating variables; data sales; set herc.sales; drop Gender Salary Job_Title Country Birth_Date Hire_Date; Bonus=500; Compensation=sum(Salary,Bonus); BonusMonth=month(Hire_Date); AnnivBonus=mdy(month(Hire_Date),15,2008); run; proc print data=sales; run; * an example from stat 431 (basic ANOVA with transformation); data gulfwaters; *infile 'S:\Courses\stat-renaes\Data\gulf.csv' dsd missover firstobs=2; input o2 Distance $; cards; 1 1KM 5 1KM 2 1KM 1 1KM 2 1KM 2 1KM 4 1KM 3 1KM 0 1KM 2 1KM 4 5KM 8 5KM 2 5KM 3 5KM 8 5KM 5 5KM 6 5KM 4 5KM 3 5KM 3 5KM 20 10KM 26 10KM 24 10KM 11 10KM 28 10KM 20 10KM 19 10KM 19 10KM 21 10KM 24 10KM 37 20KM 30 20KM 26 20KM 24 20KM 41 20KM 25 20KM 36 20KM 31 20KM 31 20KM 33 20KM ; run; proc print data=gulfwaters; run; * natural log function is log() with base e; data gulf2; set gulfwaters; lno2=log(o2+1); sqrto2=sqrt(o2); run; proc print data=gulf2; run; * original data; proc glm data=gulfwaters plots=(diagnostics residuals); class distance; model o2=distance; run; * square-root transformation; proc glm data=gulf2 plots=(diagnostics residuals); class distance; model sqrtO2=distance; run; * natural log (+1) transformation; proc glm data=gulf2 plots=(diagnostics residuals); class distance; model lno2=distance; run;