data table156multi ; input moisture $ container CO2day2 CO2day4 CO2day6 CO2day8 ; linearCO2 = -3*CO2day2 -1*CO2day4 +1*CO2day6 +3*CO2day8 ; quadraticCO2 = 1*CO2day2 -1*CO2day4 -1*CO2day6 +1*CO2day8 ; cubicCO2 = -1*CO2day2 +3*CO2day4 -3*CO2day6 +1*CO2day8 ; cards ; Control 1 .22 .56 .66 .89 Control 2 .68 .91 1.06 .80 Control 3 .68 .45 .72 .89 P24 4 2.53 2.7 2.1 1.5 P24 5 2.59 1.43 1.35 0.74 P24 6 0.56 1.37 1.87 1.21 P26 7 0.22 0.22 0.20 0.11 P26 8 0.45 0.28 1.24 0.86 P26 9 0.22 0.33 0.34 0.20 P28 10 0.22 0.80 0.80 0.37 P28 11 0.22 0.62 0.89 0.95 P28 12 0.22 0.56 0.69 0.63 ; proc print data = table156multi ; run ; * this repeated measures analysis conducts the second approach mentioned in the text, where the F test degrees of freedom are downweighted due to violation of the Huynh-Feldt condition ; proc glm data = table156multi ; class moisture container ; model CO2day2 CO2day4 CO2day6 CO2day8 = moisture / nouni ; repeated days / nom printe ; run ; * this analysis is the third approach in the text, where contrasts among the repeated measure are defined and univariate ANOVA is used ; proc glm data = table156multi ; class moisture container ; model CO2day2 CO2day4 CO2day6 CO2day8 = moisture / nouni ; repeated time polynomial / nom printe summary ; run ; * Note that the data structure is different for repeated measures analysis in Proc MIXED vs Proc GLM. GLM requires a multivariate format, while MIXED uses a univariate format ; data table156uni ; input moisture $ container day CO2 @@ ; cards ; Control 1 2 .22 Control 1 4 .56 Control 1 6 .66 Control 1 8 .89 Control 2 2 .68 Control 2 4 .91 Control 2 6 1.06 Control 2 8 .80 Control 3 2 .68 Control 3 4 .45 Control 3 6 .72 Control 3 8 .89 P24 4 2 2.53 P24 4 4 2.7 P24 4 6 2.1 P24 4 8 1.5 P24 5 2 2.59 P24 5 4 1.43 P24 5 6 1.35 P24 5 8 0.74 P24 6 2 0.56 P24 6 4 1.37 P24 6 6 1.87 P24 6 8 1.21 P26 7 2 0.22 P26 7 4 0.22 P26 7 6 0.20 P26 7 8 0.11 P26 8 2 0.45 P26 8 4 0.28 P26 8 6 1.24 P26 8 8 0.86 P26 9 2 0.22 P26 9 4 0.33 P26 9 6 0.34 P26 9 8 0.20 P28 10 2 0.22 P28 10 4 0.80 P28 10 6 0.80 P28 10 8 0.37 P28 11 2 0.22 P28 11 4 0.62 P28 11 6 0.89 P28 11 8 0.95 P28 12 2 0.22 P28 12 4 0.56 P28 12 6 0.69 P28 12 8 0.63 ; proc print data = table156uni ; run ; * This approach is related to the multivariate approach mentioned in the text, in that it models the multivariate structure among the repeated measures ; * The general approach to repeated measures analysis in Proc MIXED is to find the best fitting covariance model, then to base tests on fixed effects from this model. Different covariance models are specified via the 'type = ' option in the REPEATED statement, and a criterion such as the model AIC or BIC can be used to select the best covariance structure ; proc mixed data= table156uni ; class moisture container day ; model CO2 = moisture day moisture*day ; repeated / type=cs sub= container(moisture) r rcorr; run ; proc mixed data= table156uni ; class moisture container day ; model CO2 = moisture day moisture*day ; repeated / type= ar(1) sub= container(moisture) r rcorr; run ; proc mixed data= table156uni ; class moisture container day ; model CO2 = moisture day moisture*day / outp = rtable156uni ; repeated / type= arh(1) sub= container(moisture) r rcorr; run ; proc mixed data= table156uni ; class moisture container day ; model CO2 = moisture day moisture*day ; repeated / type= un sub= container(moisture) r rcorr; run ; proc plot vpercent = 80 data = rtable156uni ; plot resid*pred pred*day=moisture pred*moisture=day ; run ; proc capability noprint lineprinter data = rtable156uni ; var resid ; qqplot resid / normal (mu = est sigma = est symbol = '.') square ; run ;