1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;5556 /********************* uvtubes.sas ***********************/57 title 'Fungus Tube data in univariate format';5859 data mould1;60 infile '/folders/myfolders/tubes.data.txt' firstobs=2 missover;61 /* missover makes data omitted at the end of a line missing. */62 input line mcg rep day AML AMS AMld PML PMS PMld AMslp PMslp SWeight;63 label mcg = 'Fungus Type'64 rep = 'Replication (1-4)'65 AML = 'AM Length' AMS = 'AM Number of Sclerotia' AMld = 'AM Leading Edge'66 PML = 'PM Length' PMS = 'PM Number of Sclerotia' PMld = 'PM Leading Edge'67 AMslp = 'AM Least-squares Slope'68 PMslp = 'PM Least-squares Slope'69 SWeight = 'Slerotial Weight';70 Tube = 1000*rep + mcg; /* 4-digit tube identifier */71 Length = (AML+PML)/2;72 Sclerotia = (AMS+PMS)/2;73 /* Zero sclerotia were recorded as missing. */74 if Sclerotia=. then Sclerotia=0;75 Slope = (AMslp+PMslp)/2;76 if Tube ne 1213; /* Getting rid of the outlier, based on science. */7778 /* Fungus grew past the end of some tubes after day 10 so it was really a 10-day79 experiment, but day 14 has slopes and weight of sclerotia. These variables will80 still be available in mould1, with one non-missing value for each tube. */81NOTE: The infile '/folders/myfolders/tubes.data.txt' is:Filename=/folders/myfolders/tubes.data.txt,Owner Name=root,Group Name=vboxsf,Access Permission=-rwxrwx---,Last Modified=25Mar2016:08:32:33,File Size (bytes)=20782NOTE: 336 records were read from the infile '/folders/myfolders/tubes.data.txt'.The minimum record length was 59.The maximum record length was 69.NOTE: Missing values were generated as a result of performing an operation on missing values.Each place is given by: (Number of times) at (Line):(Column).46 at 71:19 61 at 72:22 312 at 75:20NOTE: The data set WORK.MOULD1 has 322 observations and 17 variables.NOTE: DATA statement used (Total process time):real time 0.01 secondscpu time 0.01 seconds82 data mould2;83 set mould1;84 if day < 11;85NOTE: There were 322 observations read from the data set WORK.MOULD1.NOTE: The data set WORK.MOULD2 has 230 observations and 17 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondscpu time 0.00 seconds86 proc print;87 var Tube mcg rep day Length Sclerotia;88NOTE: There were 230 observations read from the data set WORK.MOULD2.NOTE: PROCEDURE PRINT used (Total process time):real time 0.37 secondscpu time 0.37 seconds89 proc freq;90 title2 'Sample sizes';91 tables day*mcg / norow nocol nopercent missing;92NOTE: There were 230 observations read from the data set WORK.MOULD2.NOTE: PROCEDURE FREQ used (Total process time):real time 0.07 secondscpu time 0.07 seconds93 proc tabulate;94 title2 'Mean Length';95 class day mcg;96 var Length;97 table (day all),(mcg all) * (mean*Length);98NOTE: There were 230 observations read from the data set WORK.MOULD2.NOTE: PROCEDURE TABULATE used (Total process time):real time 0.04 secondscpu time 0.05 seconds99 proc glm;100 title2 'Proc glm just for the mean plot';101 class day mcg;102 model Length = day|mcg;103NOTE: PROCEDURE GLM used (Total process time):real time 0.63 secondscpu time 0.22 seconds104 proc mixed cl;105 title2 'Unstructured Covariance Matrix';106 class day mcg;107 model Length = day|mcg;108 repeated / type=un subject=tube;109 lsmeans mcg / pdiff adjust=bon;110 /* Test linear growth starting with day 2. H0 is111 mu1 mu2 mu3 mu4 mu5 mu6 mu7 mu8 mu9 mu10112 mu2-mu3 = mu3-mu4 <=> 0 1 -2 1 0 0 0 0 0 0113 mu3-mu4 = mu4-mu5 <=> 0 0 1 -2 1 0 0 0 0 0114 mu4-mu5 = mu5-mu6 <=> 0 0 0 1 -2 1 0 0 0 0115 mu5-mu6 = mu6-mu7 <=> 0 0 0 0 1 -2 1 0 0 0116 mu6-mu7 = mu7-mu8 <=> 0 0 0 0 0 1 -2 1 0 0117 mu7-mu8 = mu8-mu9 <=> 0 0 0 0 0 0 1 -2 1 0118 mu8-mu9 = mu9-mu10 <=> 0 0 0 0 0 0 0 1 -2 1119 */120 contrast 'LinearAfter2'121 day 0 1 -2 1 0 0 0 0 0 0,122 day 0 0 1 -2 1 0 0 0 0 0,123 day 0 0 0 1 -2 1 0 0 0 0,124 day 0 0 0 0 1 -2 1 0 0 0,125 day 0 0 0 0 0 1 -2 1 0 0,126 day 0 0 0 0 0 0 1 -2 1 0,127 day 0 0 0 0 0 0 0 1 -2 1;128129 /* Finally, test whether an ar(1) is good enough */130NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.27 secondscpu time 0.26 seconds131 proc mixed method=ml;132 title2 'Full model for Sigma is unstructured';133 class day mcg;134 model Length = day|mcg;135 repeated / type=un subject=tube;136NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.13 secondscpu time 0.13 seconds137 proc mixed method=ml;138 title2 'Reduced model for Sigma is AR(1)';139 class day mcg;140 model Length = day|mcg;141 repeated / type=ar(1) subject=tube;142NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.09 secondscpu time 0.08 seconds143 proc iml;NOTE: IML Ready144 title2 'Difference between chi-squared values is chi-squared';145 Chisquare = 382.99-219.86;145 ! df=54-1;145 ! pvalue = 1-probchi(Chisquare,df);146 print Chisquare df pvalue;147148149150 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;162