1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 /********************* uvtubes.sas ***********************/
57 title 'Fungus Tube data in univariate format';
58
59 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. */
77
78 /* Fungus grew past the end of some tubes after day 10 so it was really a 10-day
79 experiment, but day 14 has slopes and weight of sclerotia. These variables will
80 still be available in mould1, with one non-missing value for each tube. */
81
NOTE: 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)=20782
NOTE: 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:20
NOTE: The data set WORK.MOULD1 has 322 observations and 17 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
82 data mould2;
83 set mould1;
84 if day < 11;
85
NOTE: 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 seconds
cpu time 0.00 seconds
86 proc print;
87 var Tube mcg rep day Length Sclerotia;
88
NOTE: There were 230 observations read from the data set WORK.MOULD2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.37 seconds
cpu time 0.37 seconds
89 proc freq;
90 title2 'Sample sizes';
91 tables day*mcg / norow nocol nopercent missing;
92
NOTE: There were 230 observations read from the data set WORK.MOULD2.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.07 seconds
cpu time 0.07 seconds
93 proc tabulate;
94 title2 'Mean Length';
95 class day mcg;
96 var Length;
97 table (day all),(mcg all) * (mean*Length);
98
NOTE: There were 230 observations read from the data set WORK.MOULD2.
NOTE: PROCEDURE TABULATE used (Total process time):
real time 0.04 seconds
cpu time 0.05 seconds
99 proc glm;
100 title2 'Proc glm just for the mean plot';
101 class day mcg;
102 model Length = day|mcg;
103
NOTE: PROCEDURE GLM used (Total process time):
real time 0.63 seconds
cpu time 0.22 seconds
104 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 is
111 mu1 mu2 mu3 mu4 mu5 mu6 mu7 mu8 mu9 mu10
112 mu2-mu3 = mu3-mu4 <=> 0 1 -2 1 0 0 0 0 0 0
113 mu3-mu4 = mu4-mu5 <=> 0 0 1 -2 1 0 0 0 0 0
114 mu4-mu5 = mu5-mu6 <=> 0 0 0 1 -2 1 0 0 0 0
115 mu5-mu6 = mu6-mu7 <=> 0 0 0 0 1 -2 1 0 0 0
116 mu6-mu7 = mu7-mu8 <=> 0 0 0 0 0 1 -2 1 0 0
117 mu7-mu8 = mu8-mu9 <=> 0 0 0 0 0 0 1 -2 1 0
118 mu8-mu9 = mu9-mu10 <=> 0 0 0 0 0 0 0 1 -2 1
119 */
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;
128
129 /* Finally, test whether an ar(1) is good enough */
130
NOTE: Convergence criteria met.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.27 seconds
cpu time 0.26 seconds
131 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;
136
NOTE: Convergence criteria met.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.13 seconds
cpu time 0.13 seconds
137 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;
142
NOTE: Convergence criteria met.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.09 seconds
cpu time 0.08 seconds
143 proc iml;
NOTE: IML Ready
144 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;
147
148
149
150 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
162