Handout01 Stat3910/4910 Simple SAS Example. Note the "data step" at the top, the use of the if-then-else statements, the datalines command, and the Procs. See pages 3, 7, ------------------------------------------------------------------------------ data example; input subject gender $ exam1 exam2 hwgrade $; final = (exam1 + exam2)/2; If final ge 0 and final lt 65 then grade = 'F'; else if final ge 65 and final lt 75 then grade ='C'; else if final ge 75 and final lt 85 then grade ='B'; else if final ge 85 then grade ='A'; datalines; 10 M 80 84 A 7 M 85 89 A 4 F 90 86 B 14 F 88 84 C ; Proc sort data = example; by subject; run; Proc means data=example n mean std stderr maxdec=1; title 'Descriptive Statistics'; var exam1 exam2 final; run; ------------------------------------------------------------------------------ Output: Descriptive Statistics The MEANS Procedure Variable N Mean Std Dev Std Error ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ exam1 4 85.8 4.3 2.2 exam2 4 85.8 2.4 1.2 final 4 85.8 2.6 1.3 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ