1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;7071 /********************* scab1.sas ***************************/72 title 'Scab Disease Data';7374 data potato;75 infile '/home/brunner0/441s20/ScabDisease.data.txt';76 length condition $ 10.; /* Default length of character values is 8. */77 input condition $ infection;78 label infection = 'Ave percent surface covered';NOTE: The infile '/home/brunner0/441s20/ScabDisease.data.txt' is:Filename=/home/brunner0/441s20/ScabDisease.data.txt,Owner Name=brunner0,Group Name=oda,Access Permission=-rw-r--r--,Last Modified=04Jan2020:15:00:45,File Size (bytes)=578NOTE: 33 records were read from the infile '/home/brunner0/441s20/ScabDisease.data.txt'.The minimum record length was 0.The maximum record length was 16.NOTE: SAS went to a new line when INPUT statement reached past the end of a line.NOTE: The data set WORK.POTATO has 32 observations and 2 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondsuser cpu time 0.01 secondssystem cpu time 0.01 secondsmemory 754.65kOS Memory 32168.00kTimestamp 01/08/2020 03:37:34 PMStep Count 45 Switch Count 2Page Faults 0Page Reclaims 162Page Swaps 0Voluntary Context Switches 16Involuntary Context Switches 0Block Input Operations 0Block Output Operations 26479 proc freq;80 tables condition;81NOTE: There were 32 observations read from the data set WORK.POTATO.NOTE: PROCEDURE FREQ used (Total process time):real time 0.03 secondsuser cpu time 0.03 secondssystem cpu time 0.00 secondsmemory 2573.03kOS Memory 32940.00kTimestamp 01/08/2020 03:37:34 PMStep Count 46 Switch Count 2Page Faults 0Page Reclaims 262Page Swaps 0Voluntary Context Switches 9Involuntary Context Switches 0Block Input Operations 0Block Output Operations 27282 proc means;83 class condition;84 var infection;85NOTE: There were 32 observations read from the data set WORK.POTATO.NOTE: PROCEDURE MEANS used (Total process time):real time 0.03 secondsuser cpu time 0.02 secondssystem cpu time 0.01 secondsmemory 8387.40kOS Memory 40892.00kTimestamp 01/08/2020 03:37:34 PMStep Count 47 Switch Count 1Page Faults 0Page Reclaims 1963Page Swaps 0Voluntary Context Switches 14Involuntary Context Switches 0Block Input Operations 0Block Output Operations 086 proc glm;87 class condition;88 model infection = condition / clparm;89 /* clparm gives CIs for contrasts down in the estimate statements. */90 /* Pairwise multiple comparisons */91 lsmeans condition / pdiff tdiff adjust = tukey;92 lsmeans condition / pdiff tdiff adjust = bon;93 lsmeans condition / pdiff tdiff adjust = scheffe;94 /* Test some custom contrasts. Beware of alphabetical order:95 Control Fall1200 Fall300 Fall600 Spring1200 Spring300 Spring600*/96 contrast 'Overall test for comparison' condition 1 -1 0 0 0 0 0,97 condition 1 0 -1 0 0 0 0,98 condition 1 0 0 -1 0 0 0,99 condition 1 0 0 0 -1 0 0,100 condition 1 0 0 0 0 -1 0,101 condition 1 0 0 0 0 0 -1;102103 contrast 'Av. of Fall vs. Control' condition 3 -1 -1 -1 0 0 0;104 contrast 'Av. of Spring vs. Control' condition 3 0 0 0 -1 -1 -1;105 contrast 'Fall vs. Spring' condition 0 1 1 1 -1 -1 -1;106107 contrast 'Spring Amount' condition 0 0 0 0 1 -1 0,108 condition 0 0 0 0 0 1 -1;109110 contrast 'Fall Amount' condition 0 1 -1 0 0 0 0,111 condition 0 0 1 -1 0 0 0;112113 contrast 'Spr vs. Fall for 300 lbs.' condition 0 0 1 0 0 -1 0;114 contrast 'Spr vs. Fall for 600 lbs.' condition 0 0 0 1 0 0 -1;115 contrast 'Spr vs. Fall, 1200 lbs' condition 0 1 0 0 -1 0 0;116117 /* Estimate and CI for Control vs. Fall 1200 (F = t^2) */118 estimate 'Control vs. Fall 1200' condition 1 -1 0 0 0 0 0;119 estimate 'Control vs. Mean of Fall'120 condition 3 -1 -1 -1 0 0 0 / divisor = 3;121122123 /* Scheffe critical value for a test of s contrasts is critval * (p-1)/s.124 For p=7 means and a single contrast, it's critval * (7-1)/1 */NOTE: PROCEDURE GLM used (Total process time):real time 1.28 secondsuser cpu time 0.76 secondssystem cpu time 0.03 secondsmemory 19274.04kOS Memory 50524.00kTimestamp 01/08/2020 03:37:35 PMStep Count 48 Switch Count 2Page Faults 0Page Reclaims 5575Page Swaps 0Voluntary Context Switches 4252Involuntary Context Switches 0Block Input Operations 0Block Output Operations 2680125 proc iml;NOTE: IML Ready126 title2 'Critical value for all possible 1-df Scheffe F-tests';127 numdf = 6;127 ! /* p-1 = Numerator degrees of freedom for initial test */128 dendf = 25;128 ! /* n-p = Denominator degrees of freedom for initial test */129 alpha = 0.05;130 critval = finv(1-alpha,numdf,dendf);130 ! print critval;131 ScheffeCritval = critval*numdf;131 ! print ScheffeCritval;132NOTE: Exiting IML.NOTE: PROCEDURE IML used (Total process time):real time 0.01 secondsuser cpu time 0.01 secondssystem cpu time 0.00 secondsmemory 468.71kOS Memory 48548.00kTimestamp 01/08/2020 03:37:35 PMStep Count 49 Switch Count 1Page Faults 0Page Reclaims 139Page Swaps 0Voluntary Context Switches 9Involuntary Context Switches 0Block Input Operations 0Block Output Operations 0133 proc iml;NOTE: IML Ready134 title2 'Table of Scheffe critical values for COLLECTIONS of contrasts';135 numdf = 6;135 ! /* Numerator degrees of freedom for initial test */136 dendf = 25;136 ! /* Denominator degrees of freedom for initial test */137 alpha = 0.05;138 critval = finv(1-alpha,numdf,dendf);139 zero = {0 0};139 ! S_table = repeat(zero,numdf,1);139 ! /* Make empty matrix */140 /* Label the columns */141 namz = {"Number of Contrasts in followup F-test"142 " Scheffe Critical Value"};143 mattrib S_table colname=namz;144 do i = 1 to numdf;145 s_table(|i,1|) = i;146 s_table(|i,2|) = numdf/i * critval;147 end;148 reset noname;148 ! /* Makes output look nicer in this case */149 print "Initial test has" numdf " and " dendf "degrees of freedom."150 "Using significance level alpha = " alpha;151 print s_table;152153 /* Example of subsetting vs. contrasts */154NOTE: Exiting IML.NOTE: PROCEDURE IML used (Total process time):real time 0.02 secondsuser cpu time 0.02 secondssystem cpu time 0.00 secondsmemory 536.37kOS Memory 48548.00kTimestamp 01/08/2020 03:37:35 PMStep Count 50 Switch Count 1Page Faults 0Page Reclaims 134Page Swaps 0Voluntary Context Switches 10Involuntary Context Switches 0Block Input Operations 0Block Output Operations 0155 proc glm;156 title2 'Test differences among treatments excluding control';157 title3 'Using contrasts of all means (traditional)';158 class condition;159 model infection = condition;160 contrast 'Differences excluding control' condition 0 1 -1 0 0 0 0,161 condition 0 0 1 -1 0 0 0,162 condition 0 0 0 1 -1 0 0,163 condition 0 0 0 0 1 -1 0,164 condition 0 0 0 0 0 1 -1;165NOTE: PROCEDURE GLM used (Total process time):real time 0.23 secondsuser cpu time 0.12 secondssystem cpu time 0.01 secondsmemory 4067.28kOS Memory 50752.00kTimestamp 01/08/2020 03:37:36 PMStep Count 51 Switch Count 4Page Faults 0Page Reclaims 494Page Swaps 0Voluntary Context Switches 659Involuntary Context Switches 0Block Input Operations 0Block Output Operations 752166 proc glm;167 title2 'Test differences among treatments excluding control';168 title3 'Subset the data by excluding control';169 where condition ne 'Control'; /* Case sensitive */170 class condition;171 model infection = condition;172173174175 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;186