HW 2 comments ... 1) avoid variables that match function names ... mean = mean(y1, y2, y3); * it works (in SAS) but not so great; mean_ct = mean(y1, y2, y3); * better; * even though the following works, I suggest avoiding this; data data; input y x; ... data data; set data; .... 2) data pkg; input y1 condition $ / y2 / y3; datalines; 7.66 Plastic 6.98 Plastic 7.90 Plastic 5.26 Vacuum ... ; =======> "pkg" data set Plastic 7.66 6.98 7.90 Vacuum 5.26 ... Mixed Co2 3) SQL can be used to create multiple tables - you don't have to quit and restart each time you want to build a new table 4) You could do this assignment using SQL or DATA step programming with IN statements. Suggestion: if you did this assignment using DATA step prog, try doing with SQL (and vice versa). 5) When do you know code didn't work? * if you see multiple rows with the same ID (ID=1 shows up twice) * if you have more rows in the table you construct than data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> HW 3 questions ... data hw3_data; if RestPulse <= 48 then row_cat=1; else if RestPulse <= 52 then row_cat=2; else if RestPulse <= 59 then row_cat=3; else if RestPulse <= 75 then row_cat=4; /* don't do this */ if RestPulse <= 48 then row_cat=1; if RestPulse <= 52 then row_cat=2; if RestPulse <= 59 then row_cat=3; if RestPulse <= 75 then row_cat=4; /* could do this */ if RestPulse <= 48 then row_cat=1; if 48 < RestPulse <= 52 then row_cat=2; if 52 < RestPulse <= 59 then row_cat=3; if 59 < RestPulse <= 75 then row_cat=4; proc freq data=hw3_data; table row_cat*col_cat / chisq trend; exact chisq; run;