Handout03 Stat3900/4950 When using proc means what is the difference between using the "by" subcommand or the "class" subcommand? How to use the "output" subcommand to create a new data set. ------------------------------------------------------------------------------ data school; length gender $ 1 teacher $5; input subject gender $ teacher $ t_age pretest posttest; gain = posttest-pretest; datalines; 1 M Jones 35 67 81 2 F Jones 35 98 86 3 M Jones 35 52 92 4 M Black 42 41 74 5 F Black 42 46 76 ; /* Compute the mean and stdev of the pretest, posttest, and gain for each teacher. Using the "by" subcommand and the "class" subcommand. */ proc means data=school n mean std maxdec=2; class teacher; title 'Mean scores for each teacher'; var pretest posttest gain; run; proc sort data=school; by teacher; run; proc means data=school n mean std maxdec=2; by teacher; title 'Mean scores for each teacher'; var pretest posttest gain; run; /* Create a new data set using the "output" subcommand. */ proc means data=school noprint nway; class teacher; var pretest posttest gain; output out=teachsum n = n_pre n_post n_gain mean = m_pre m_post m_gain std = s_pre s_post s_gain max = max_pre max_post max_gain min = min_pre min_post min_gain; run; proc print data=teachsum; title 'Listing of data set teachsum'; run; proc contents data=school postion; run; ------------------------------------------------------------------------------