1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;NOTE: ODS statements in the SAS Studio environment may disable some output features.7172 /********************* scab2.sas (2020 version) **********************/73 title 'Randomization Tests on the Scab Disease Data';7475 data potato;76 infile '/home/brunner0/441s20/ScabDisease.data.txt';77 length condition $ 10.; /* Default length of character values is 8. */78 input condition $ infection;79 label infection = 'Ave percent surface covered';8081 ods select OverallANOVA;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:16: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.00 secondssystem cpu time 0.00 secondsmemory 754.46kOS Memory 29096.00kTimestamp 03/29/2020 02:59:01 PMStep Count 62 Switch Count 3Page Faults 0Page Reclaims 165Page Swaps 0Voluntary Context Switches 29Involuntary Context Switches 0Block Input Operations 0Block Output Operations 26482 proc glm data=potato order=data;83 title2 'With proc glm for Comparison';84 class condition;85 model infection=condition;86 run;87NOTE: PROCEDURE GLM used (Total process time):real time 0.03 secondsuser cpu time 0.04 secondssystem cpu time 0.00 secondsmemory 3836.46kOS Memory 31416.00kTimestamp 03/29/2020 02:59:01 PMStep Count 63 Switch Count 3Page Faults 0Page Reclaims 585Page Swaps 0Voluntary Context Switches 22Involuntary Context Switches 0Block Input Operations 0Block Output Operations 74488 proc means data = potato order=data;89 class condition; var infection;90 run;NOTE: 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 8372.78kOS Memory 38844.00kTimestamp 03/29/2020 02:59:01 PMStep Count 64 Switch Count 1Page Faults 0Page Reclaims 2182Page Swaps 0Voluntary Context Switches 24Involuntary Context Switches 0Block Input Operations 0Block Output Operations 09192 proc npar1way wilcoxon data=potato;93 title2 'Classical Kruskal-Wallis Test';94 class condition;95 var infection;96 exact / mc seed=77777 maxtime=300;97 /* It will never take 5 minutes, but just to be safe .... */98 run;NOTE: PROCEDURE NPAR1WAY used (Total process time):real time 2.53 secondsuser cpu time 0.17 secondssystem cpu time 0.02 secondsmemory 14797.34kOS Memory 44716.00kTimestamp 03/29/2020 02:59:04 PMStep Count 65 Switch Count 1Page Faults 0Page Reclaims 4371Page Swaps 0Voluntary Context Switches 792Involuntary Context Switches 0Block Input Operations 0Block Output Operations 89699100 proc npar1way scores=data data=potato;101 title2 'Randomization Test';102 class condition;103 var infection;104 exact / mc seed=88888 maxtime=300;105 run;NOTE: PROCEDURE NPAR1WAY used (Total process time):real time 0.31 secondsuser cpu time 0.12 secondssystem cpu time 0.01 secondsmemory 3146.09kOS Memory 46132.00kTimestamp 03/29/2020 02:59:04 PMStep Count 66 Switch Count 1Page Faults 0Page Reclaims 541Page Swaps 0Voluntary Context Switches 627Involuntary Context Switches 0Block Input Operations 0Block Output Operations 696106107 /* Follow up with proc multtest. All 21 pairwise comparisons plus108 * Control vs. Average of Spring109 * Control vs. Average of Fall110 * Average of Spring vs. Average of Fall111 */112113 proc multtest data=potato order=data114 permutation nsample=20000 seed=99999 ;115 title2 'Randomization multiple comparisons with proc multtest';116 class condition;117 /* Pairwise Bonferroni */118 contrast 'Control vs. Spring300' 1 -1 0 0 0 0 0; /* 1.0000 */119 contrast 'Control vs. Spring600' 1 0 -1 0 0 0 0; /* 1.0000 */120 contrast 'Control vs. Spring1200' 1 0 0 -1 0 0 0; /* 1.0000 */121 contrast 'Control vs. Fall300' 1 0 0 0 -1 0 0; /* 0.0888 */122 contrast 'Control vs. Fall600' 1 0 0 0 0 -1 0; /* 1.0000 */123 contrast 'Control vs. Fall1200' 1 0 0 0 0 0 -1; /* 0.0096 */124 contrast 'Spring300 vs. Spring600' 0 1 -1 0 0 0 0;125 contrast 'Spring300 vs. Spring1200' 0 1 0 -1 0 0 0;126 contrast 'Spring300 vs. Fall300' 0 1 0 0 -1 0 0;127 contrast 'Spring300 vs. Fall600' 0 1 0 0 0 -1 0;128 contrast 'Spring300 vs. Fall1200' 0 1 0 0 0 0 -1;129 contrast 'Spring600 vs. Spring1200' 0 0 1 -1 0 0 0;130 contrast 'Spring600 vs. Fall300' 0 0 1 0 -1 0 0;131 contrast 'Spring600 vs. Fall600' 0 0 1 0 0 -1 0;132 contrast 'Spring600 vs. Fall1200' 0 0 1 0 0 0 -1;133 contrast 'Spring1200 vs. Fall300' 0 0 0 1 -1 0 0;134 contrast 'Spring1200 vs. Fall600' 0 0 0 1 0 -1 0;135 contrast 'Spring1200 vs. Fall1200' 0 0 0 1 0 0 -1;136 contrast 'Fall300 vs. Fall600' 0 0 0 0 1 -1 0;137 contrast 'Fall300 vs. Fall1200' 0 0 0 0 1 0 -1;138 contrast 'Fall600 vs. Fall1200' 0 0 0 0 0 1 -1;139 /* Averages */140 contrast 'Control vs. Spring' 3 -1 -1 -1 0 0 0;141 contrast 'Control vs. Fall' 3 0 0 0 -1 -1 -1;142 contrast 'Spring vs. Fall' 0 1 1 1 -1 -1 -1;143 test mean(infection); /* Requests t-tests */144 run;NOTE: The multiple testing procedure for this run is not closed. In cases with badly heteroskedastic data, tests for individualnull hypotheses can have inflated familywise Type I error rates.NOTE: There were 32 observations read from the data set WORK.POTATO.NOTE: PROCEDURE MULTTEST used (Total process time):real time 0.31 secondsuser cpu time 0.32 secondssystem cpu time 0.00 secondsmemory 1178.37kOS Memory 45224.00kTimestamp 03/29/2020 02:59:05 PMStep Count 67 Switch Count 1Page Faults 0Page Reclaims 77Page Swaps 0Voluntary Context Switches 13Involuntary Context Switches 0Block Input Operations 0Block Output Operations 48145146 /* The only issue is Controll vs. Fall300. p = 0.0519, but it's an147 ESTIMATE of the p-value from a randomization test. Is it148 SIGNIFICANTLY above 0.05? */149150 proc iml;NOTE: IML Ready151 title2 'Testing H0: p = 0.05 with a large-sample Z-test for proportions';152 p = 0.0519;152 ! n = 20000;152 ! Z = sqrt(n)*(p-0.05)/sqrt(0.05*0.95);153 print p Z;154 quit;NOTE: Exiting IML.NOTE: PROCEDURE IML used (Total process time):real time 0.01 secondsuser cpu time 0.01 secondssystem cpu time 0.00 secondsmemory 509.50kOS Memory 44964.00kTimestamp 03/29/2020 02:59:05 PMStep Count 68 Switch Count 1Page Faults 0Page Reclaims 133Page Swaps 0Voluntary Context Switches 11Involuntary Context Switches 0Block Input Operations 0Block Output Operations 8155156 /* Try a bigger MC sample size: 200 thousand. */157158 proc multtest data=potato order=data159 permutation nsample=200000 seed=99999 ;160 title2 'Bigger MC sample size: See Control vs. Fall300';161 class condition;162 /* Pairwise Bonferroni */163 contrast 'Control vs. Spring300' 1 -1 0 0 0 0 0; /* 1.0000 */164 contrast 'Control vs. Spring600' 1 0 -1 0 0 0 0; /* 1.0000 */165 contrast 'Control vs. Spring1200' 1 0 0 -1 0 0 0; /* 1.0000 */166 contrast 'Control vs. Fall300' 1 0 0 0 -1 0 0; /* 0.0888 */167 contrast 'Control vs. Fall600' 1 0 0 0 0 -1 0; /* 1.0000 */168 contrast 'Control vs. Fall1200' 1 0 0 0 0 0 -1; /* 0.0096 */169 contrast 'Spring300 vs. Spring600' 0 1 -1 0 0 0 0;170 contrast 'Spring300 vs. Spring1200' 0 1 0 -1 0 0 0;171 contrast 'Spring300 vs. Fall300' 0 1 0 0 -1 0 0;172 contrast 'Spring300 vs. Fall600' 0 1 0 0 0 -1 0;173 contrast 'Spring300 vs. Fall1200' 0 1 0 0 0 0 -1;174 contrast 'Spring600 vs. Spring1200' 0 0 1 -1 0 0 0;175 contrast 'Spring600 vs. Fall300' 0 0 1 0 -1 0 0;176 contrast 'Spring600 vs. Fall600' 0 0 1 0 0 -1 0;177 contrast 'Spring600 vs. Fall1200' 0 0 1 0 0 0 -1;178 contrast 'Spring1200 vs. Fall300' 0 0 0 1 -1 0 0;179 contrast 'Spring1200 vs. Fall600' 0 0 0 1 0 -1 0;180 contrast 'Spring1200 vs. Fall1200' 0 0 0 1 0 0 -1;181 contrast 'Fall300 vs. Fall600' 0 0 0 0 1 -1 0;182 contrast 'Fall300 vs. Fall1200' 0 0 0 0 1 0 -1;183 contrast 'Fall600 vs. Fall1200' 0 0 0 0 0 1 -1;184 /* Averages */185 contrast 'Control vs. Spring' 3 -1 -1 -1 0 0 0;186 contrast 'Control vs. Fall' 3 0 0 0 -1 -1 -1;187 contrast 'Spring vs. Fall' 0 1 1 1 -1 -1 -1;188 test mean(infection); /* Requests t-tests */189 run;NOTE: The multiple testing procedure for this run is not closed. In cases with badly heteroskedastic data, tests for individualnull hypotheses can have inflated familywise Type I error rates.NOTE: There were 32 observations read from the data set WORK.POTATO.NOTE: PROCEDURE MULTTEST used (Total process time):real time 2.22 secondsuser cpu time 2.23 secondssystem cpu time 0.00 secondsmemory 847.21kOS Memory 45224.00kTimestamp 03/29/2020 02:59:07 PMStep Count 69 Switch Count 1Page Faults 0Page Reclaims 51Page Swaps 0Voluntary Context Switches 13Involuntary Context Switches 3Block Input Operations 0Block Output Operations 48190191 proc iml;NOTE: IML Ready192 title2 'Another large-sample Z-test of H0: p = 0.05';193 p = 0.0515;193 ! n = 200000;193 ! Z = sqrt(n)*(p-0.05)/sqrt(0.05*0.95);194 print p Z;195 quit;NOTE: Exiting IML.NOTE: PROCEDURE IML used (Total process time):real time 0.01 secondsuser cpu time 0.01 secondssystem cpu time 0.00 secondsmemory 501.15kOS Memory 44964.00kTimestamp 03/29/2020 02:59:07 PMStep Count 70 Switch Count 1Page Faults 0Page Reclaims 133Page Swaps 0Voluntary Context Switches 11Involuntary Context Switches 0Block Input Operations 0Block Output Operations 8196197198199200201 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;212