206 data ch5; 207 input Rep Trt Yield; 208 datalines; NOTE: The data set WORK.CH5 has 12 observations and 3 variables. NOTE: DATA statement used: real time 0.02 seconds cpu time 0.00 seconds 221 ;; 222 proc print; 223 *COMMENT: The proc print statement will print all data; 224 title 'Data for Chapter 5 Example for Comparing Difference Between Two Treatment Means'; 225 *COMMENT: In the title command, the acutal title must be surrounded by single quotes.; 226 run; NOTE: There were 12 observations read from the data set WORK.CH5. NOTE: PROCEDURE PRINT used: real time 0.01 seconds cpu time 0.01 seconds 227 proc sort; 228 by trt; 229 *COMMENT: When you want to do proc statements for multiple treatments, you need to sort 229! your data first; NOTE: There were 12 observations read from the data set WORK.CH5. NOTE: The data set WORK.CH5 has 12 observations and 3 variables. NOTE: PROCEDURE SORT used: real time 0.02 seconds cpu time 0.01 seconds 230 proc means maxdec=2 ; 231 by trt; 232 var yield; 233 Title 'Proc Means Output for Descriptive Statistics'; 234 Run; NOTE: There were 12 observations read from the data set WORK.CH5. NOTE: PROCEDURE MEANS used: real time 0.01 seconds cpu time 0.01 seconds 235 proc ttest; 236 class trt; 237 *COMMENT: The class statement tells the computer which variable includes the treatment 237! names; 238 var yield; 239 title 'T-test to compare Treatments 1 and 2'; 240 run; NOTE: There were 12 observations read from the data set WORK.CH5. NOTE: PROCEDURE TTEST used: real time 0.01 seconds cpu time 0.01 seconds 241 proc means noprint; 242 by trt; 243 var yield; 244 output out=new mean=meanyld; 245 NOTE: There were 12 observations read from the data set WORK.CH5. NOTE: The data set WORK.NEW has 2 observations and 4 variables. NOTE: PROCEDURE MEANS used: real time 0.02 seconds cpu time 0.02 seconds 246 proc print; 247 *COMMENT: The statements above are great for producing a new data set based on means from 247! another 248 data set.; 249 title 'Proc Means Statent Used to Produce New Dataset Using Means'; 250 run; NOTE: There were 2 observations read from the data set WORK.NEW. NOTE: PROCEDURE PRINT used: real time 0.00 seconds cpu time 0.00 seconds