/* Using transformed variables in 2 sample t-tests */ /* to transform variables, add lines to the DATA step that */ /* define new variables as transformations of the old ones */ /* For example, lrain is the log transformation of rainfall */ /* and rrain is the reciprocal transformation of rainfall */ /* to do analyses on the transformed variables, just specify those */ /* variable names in each proc step */ data rainfall; infile '~/WWW/stat401/data/case0301.txt'; input rain code; lrain = log(rain); /* N.B. this natural log */ l10rain = log10(rain); /* this is log base 10 */ srain = sqrt(rain); /* Square root transformation */ rrain = 1/rain; /* reciprocal transformation */ run; /* sort the data, so that all observations from one treatment are together */ proc sort; by code; proc boxplot; plot rain*code; plot lrain*code; run; proc ttest data=rainfall; class code; var lrain rain; title 't-test for the cloud seeding data - natural scale and log scale'; run;