Analysis of Repeated Measures Data

Ramon C. Littell

Outline:

1. Introduction

2. Uni-variate and Multi-variate Analyses Using PROC GLM

3. Mixed Model Analyses Using PROC MIXED

5 47.0 17.0 13.0 4.0sumag 9 3 3 1 3.0 33.0 37.5 16.0 17.0sumag 13 4 3 1 2.5 30.5 6.5 5.0 26.0 31.0 2.5 4.0sumag 16 4 9 2 4.0 26. estimate ‘bonzi-sumag’ chem 1 -1.0 45.0 31.5sumag 4 1 9 2 4.5 18.0 21.5 44.0 35.0 2.5 29.0 3.0 2.5bonzi 14 4 3 2 3.0 38.0 4. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Multivariate Data Set proc print data=mumsmult.0 41.0 2.5 19.0bonzi 15 4 9 1 4.0 48.0 40.0 4. class blk chem plt.0 4.0sumag 17 5 3 1 2.0 35.0 31.0 19.0 4.5 32.5 6.0 5.0 46.0 45. Obs blk trt plt ht1 ht2 ht3 ht4 ht5 ht6 elong chem 1 1 3 1 3.0 17.5bonzi 18 5 3 2 3.5 4.0 43.5 23.0 6.5 43.5 3.5 19.0 2.0 19.0 36.5 44.0 4.0 5.0bonzi 11 3 9 1 3.5 4.5 3.0 4.0 6.0 3.0 40.5 8.0 19.0bonzi 3 1 9 1 1.0 30.0 28.0 2.0 4.0 6.5 25.5 20.0 3.5bonzi 2 1 3 2 2. The GLM Procedure Class Level Information Class LevelsValues blk 51 2 3 4 5 chem 2bonzi sumag plt 21 2 Number of Observations Read 20 Number of Observations Used 20 .0 47.0 17.0 44.5 35.5 17.5 37.5 44.0 50.5sumag 12 3 9 2 2.0 33.5 41.0bonzi 7 2 9 1 3.5 15.0 21.5 46.5 4.0 43.5 6.5 48.0 5.5 33.5 43.5 46.0 4.0 9.5 30.0 41.5 33. model ht1-ht6 = blk chem blk*chem.0 14.5 7.0 34.5 5.0sumag Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Univariate ANOVA at each time proc glm data=mumsmult.0bonzi 10 3 3 2 3.0 7.0sumag 20 5 9 2 4.0 5.0 33.0 40.5 11.5 40.0 44.0bonzi 6 2 3 2 4.5 10.5 47.5 7.0 34.0sumag 5 2 3 1 1.5 54.5 45.0sumag 8 2 9 2 3.0 48.0bonzi 19 5 9 1 3.5 14.5 5.

1 46. corresponding to growth of plants • Univariate analyses at each time are valid.325 .25) 177(.16250000 Corrected Total 19 16.46 27.28 0.30) 6.51) 0.06) Blk*Chem .6836 Parameter Estimate Standard t Value Pr > |t| Error bonzi-sumag -0.10) 231(.24178 1.2 Error 1.73 0.95 5.16 0.53 0.0 54.61250000 0. err.62500000 1.35000000 0. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Univariate ANOVA at each time The GLM Procedure Dependent Variable: ht1 Source DF Sum of Mean Square F Value Pr > F Squares Model 9 4.44 0.48) .5 Chem .64 25.450(.61250000 0.70000000 0. even though trends appear to separate at Time 4 • Mean squares increase with Time.73 27.975000 Source DF Type III SS Mean Square F Value Pr > F blk 4 1.48218254 -0.07) 2.30000000 0.05(.10(1.80(3.3 46.58 0.4846 Summary of Results from ANOVA at each Time Mean Squares (p-values) and Chem Differences (std.30(.078193 2.675 .4846 blk*chem 4 2.24) Conclusions: • Differences between Chems not statistically significant until Time 6.4 52.481 2.284065 36.5 Difference -0.8 54.613(.36) 5. but not most efficient .67500000 0.32500000 0.93) 40.8846 chem 1 0.95(3.23750000 R-Square Coeff Var Root MSE ht1 Mean 0.8834 Error 10 11.51250000 0.6(.44) -0.61250000 0.48) -0.85(2.0 37.794 3.35(.) at each Time Time 1 2 3 4 5 6 Blk .

63933626 2.831303 0.75942574 591.722152 <.13 5 6 0.0091 0.77266579 2.821807 0.36066374 2.5 N=2 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.688022 0.951572 1.831303 0.0193 0.1925 Pillai's Trace 0.788787 <.688554 0.918780 1.0001 ht6 0.909319 0.0193 ht2 0.0121 0.0001 MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no time*chem Effect H = Type III SSCP Matrix for Time*Chem E = Error SSCP Matrix S=1 M=1.1925 Conclusions from Multivariate ANOVA: • Effect of Time significant—no surprise • Time*Chem not significant—reflects weakness of multivariate test .77266579 2. Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r| DF = 10 ht1 ht2 ht3 ht4 ht5 ht6 ht1 1.0001 <.0001 <.0037 0.0191 0.788787 0.0121 ht3 0.0039 0.99797472 591.909319 0.0001 <.000000 0.0037 <.13 5 6 0.821807 0.915772 0.31 5 6 <.791272 0.740812 0.31 5 6 <.75942574 591.722152 0.0001 0.0001 MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no time Effect H = Type III SSCP Matrix for Time E = Error SSCP Matrix S=1 M=1.688022 <.5 N=2 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.31 5 6 <.951572 0.927271 1.0001 <.000000 0.0001 0.31 5 6 <.0001 Roy's Greatest Root 492.1925 Roy's Greatest Root 1.927271 0.0015 <.13 5 6 0.989512 0.000000 0.0019 0.0091 0.791272 0.740812 0.000000 0. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Multivariate ANOVA repeated time / printe.0019 0.0001 <.0001 <.0001 0.000000 0.13 5 6 0.0001 Hotelling-Lawley Trace 492.0015 0.0001 <.922833 0.0001 ht5 0.918780 0.915772 0.0191 0.0039 ht4 0.989512 1.0001 0.0001 Pillai's Trace 0.00202528 591.688554 0.1925 Hotelling-Lawley Trace 1.922833 1.000000 0.

18) • Chem*Time significant (unadj.23375 5.0208333 89.0001 Orthogonal Components 14 6.80 0.03333 11.15167 1.1750000 0.4184 0.0001 Conclusions: • Sphericity Assumption does not hold • Therefore Split-plot in Time analysis is not justified.0001 time*blk 20 223. p=.5425 chem 1 183.5505 “Whole plot” Error 10 899.4270 0.16875 53.62750 0.0008.68542 5287.7000000 72.6112 “Sub plot” Error 50 526.4916667 0.06 0.6799 0.0107 time*blk*chem 20 172.5531 0.53708 502.0008 0.60417 10.01) Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Test for Justification of “Split-plot in time” ANOVA Sphericity Tests Variables DF Mauchly's Chi-Square Pr > ChiSq Criterion Transformed Variates 14 4.406309 <.7687500 2. .04 0.1833 blk*chem 4 288.82 0.7687500 183.55000 8.53208 Conclusions from Split-plot in Time ANOVA: • Chem Diff not significant (p=.0001 <.7767E-6 96.9666667 73.04 <.9020833 The GLM Procedure Repeated Measures Analysis of Variance Univariate Tests of Hypotheses for Within Subject Effects Source DF Type III SS Mean Square F Value Pr > F Adj Pr > F G-G H-F time 5 26437. H-F adj.0001 <.17504 <.6116E-7 118.4276 time*chem 5 266.05 0.82 0. p=. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Univariate ANOVA (Split-plot in time) The GLM Procedure Repeated Measures Analysis of Variance Tests of Hypotheses for Between Subjects Effects Source DF Type III SS Mean Square F Value Pr > F blk 4 293. It would result in incorrect standard errors and invalid test of hypothesis.0403 0.

5 10 1 3 2bonzi 4 18.5 24 1 9 2sumag 6 44.5 36 2 3 2bonzi 6 54.5 29 2 3 1bonzi 5 35.0 39 2 9 1sumag 3 5.0 23 1 9 2sumag 5 31.0 27 2 3 1bonzi 3 4.0 18 1 9 1sumag 6 26.0 14 1 9 1sumag 2 2.5 21 1 9 2sumag 3 7.0 35 2 3 2bonzi 5 41.0 6 1 3 1bonzi 6 44.0 31 2 3 2bonzi 1 4.5 13 1 9 1sumag 1 1.0 22 1 9 2sumag 4 17.5 8 1 3 2bonzi 2 3.0 32 2 3 2bonzi 2 4.0 17 1 9 1sumag 5 14.0 26 2 3 1bonzi 2 2.5 40 2 9 1sumag 4 17.0 25 2 3 1bonzi 1 1.0 38 2 9 1sumag 2 4.0 2 1 3 1bonzi 2 4.5 12 1 3 2bonzi 6 46. Obs blk trt plt chem time ht 1 1 3 1bonzi 1 3.5 4 1 3 1bonzi 4 19.0 3 1 3 1bonzi 3 5.5 33 2 3 2bonzi 3 11.0 9 1 3 2bonzi 3 5.0 11 1 3 2bonzi 5 33.5 34 2 3 2bonzi 4 29.0 28 2 3 1bonzi 4 17.0 15 1 9 1sumag 3 2.5 30 2 3 1bonzi 6 47.5 19 1 9 2sumag 1 4.0 20 1 9 2sumag 2 4.5 7 1 3 2bonzi 1 2. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses proc print data=mumsuni.5 5 1 3 1bonzi 5 33.0 37 2 9 1sumag 1 3.5 .0 16 1 9 1sumag 4 6.

A major distinction is that only fixed effects appear in the model statement. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses Mixed Model analysis of repeated measures data incorporates the covariance into the analysis. model ht = chem time chem*time / ddfm=kr.21399990 1 1 356. proc mixed data=mumsuni. The MIXED procedure employs likelihood methods to fit the model and compute inferential statistics. It is usually to begin with unstructured covariance to examine the covariance matrix for patterns. The Mixed Procedure Model Information Data Set WORK. The MIXED procedure uses syntax similar to the GLM procedure.00000000 Convergence criteria met. This is good news! .MUMSUNI Dependent Variable ht Covariance Structure Unstructured Subject Effect plt(blk*chem) Estimation Method REML Residual Variance Method None Fixed Effects SE Method Prasad-Rao-Jeske-Kackar-Harville Degrees of Freedom Method Kenward-Roger Class Level Information Class LevelsValues blk 51 2 3 4 5 chem 2bonzi sumag plt 21 2 time 61 2 3 4 5 6 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 669. resulting in efficient and valid analyses. repeated time / sub=plt(chem time) type=un r rcorr.89670434 0. The first step is to model the covariance structure. class blk chem plt time. The repeated statement is used to define the covariance structure.

0000 0.8260 0.7011 0.correlations of equal time lag are similar .6236 1.7386 0.6596 0.9293 0.5236 34.5361 10. etc.1736 4. • General pattern: .7327 0.3125 49.8260 0.9903 5 4.0000 Interpretation: • The correlation is .8681 at time 1.9293 1.9302 0.5417 Interpretation: • The variance of height is .8182 0.7422 0.6364 2 0.7920 4 0.7583 12.4639 10. .9903 49. etc.0000 0.6236 3.3750 4.2403 12.7806 1.6444 11.8722 4 3.8162 between times 2 and 3.9842 6 0.7327 3 0.9302 between heights at times 1 and 2.7806 0.covariances increase with time Correlation Matrix from rcorr option in repeated statement: Estimated R Correlation Matrix for plt(blk*chem) 1 1 bonzi Row Col1 Col2 Col3 Col4 Col5 Col6 1 1.6444 3 1.8182 between times 1 and 3.623 between times 1 and 3.4014 3.7422 0.8168 0. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses Covariance Matrix from r option in repeated statement: Estimated R Matrix for plt(blk*chem) 1 1 bonzi Row Col1 Col2 Col3 Col4 Col5 Col6 1 0.566 between times 2 and 3.4014 4.2403 27.5667 4.8168 1.8182 0. 1.9001 5 0.7920 0.9233 1.correlations decrease with time interval .8111 1.5236 11.7806 between heights at times 1 and 2.0000 0.4639 4.1181 34.variances increase with time .6736 49.3125 6 4. 1.9842 1. 4.8681 0. etc.9233 0. • General pattern: .9001 0.6364 0. .7011 0.4472 32.0000 0. • The covariance is .8111 at time 2.1736 2 0. .7386 0.4472 50.6596 0.7583 4.536 at time 3.3750 4.5667 3.8722 32.0000 0.9302 1.

28045811 0.21399990 1 2 390.71128525 0.73086224 0.00057582 5 1 386.04137490 2 1 389.71128394 0.00000000 Convergence criteria met.MUMSUNI Dependent Variable ht Covariance Structure Heterogeneous Autoregressive Subject Effect plt(blk*chem) Estimation Method REML Residual Variance Method None Fixed Effects SE Method Prasad-Rao-Jeske-Kackar-Harville Degrees of Freedom Method Kenward-Roger Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 669. One such candidate is heterogeneous autoregressive. model ht = chem time chem*time / ddfm=kr. more good news.36247704 0. proc mixed data=mumsuni. .71272264 0. repeated time / sub=plt(chem time) type=arh(1) r rcorr.00000001 7 1 386.00001498 6 1 386.02128789 3 1 387. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses Selecting a Covariance Structure The next step is to select a covariance structure from those with the characteristics identified in the “unstructured” covariance and correlation matrices. The Mixed Procedure Model Information Data Set WORK.77198610 0. Interpretation: The estimation algorithm converges in 7 steps. class blk chem plt time.00456145 4 1 386.

6484 13.7355 0.5708 44.7942 0.2716 5.0623 2.0000 0.9780 2.0000 0.7942 4 0.0000 Fit Statistics -2 Res Log Likelihood 386.6484 27.8999 5 5.6636 11.8335 3 2.9261 0.5708 28.8576 0.7942 0.7942 0.95 <.2904 40.8576 0.3011 4.2811 39.0498 0.2716 4.0000 0.0913 4.6491 Estimated R Correlation Matrix for plt(blk*chem) 1 1 bonzi Row Col1 Col2 Col3 Col4 Col5 Col6 1 1.7 Interpretation: The arh(1) covariance and correlation matrices are similar to the “unstructured” matrices.6 2.0511 28.5819 32.4475 13.4498 4.6812 0.9780 1.9261 0.0913 2.1393 time 5 35.0151 4.0151 5.7355 3 0.8 and the BIC fit index is 407.39 0.8576 0.0511 4 4.0001 chem*time 5 35.7 AICC (smaller is better) 401.9261 1.9261 1. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses Selecting a Covariance Structure Estimated R Matrix for plt(blk*chem) 1 1 bonzi Row Col1 Col2 Col3 Col4 Col5 Col6 1 1.9261 0.9261 1.6720 11.0361 Interpretation: Chem*time is significant (p=.9261 6 0.9261 1.0000 0.7.8576 5 0.8576 0.7 AIC (smaller is better) 400.7942 0.8999 39.70 0. Type 3 Tests of Fixed Effects Effect Num Den F Value Pr > F DF DF chem 1 18.7355 0.4498 2 0.9341 32.9 2.5819 12.8576 0.9261 0.0000 0.2904 6 4.8 BIC (smaller is better) 407.8576 0. The AICC fit index is 401.8576 0.7942 0.3011 5.9 274.9261 1.8335 12.036) when using the arh(1) covariance .4475 4.7355 0.6812 2 0.6720 5.

60761870 17800. class blk chem plt time. Interpretation: The estimation algorithm converges in 8 steps. even more good news.00000106 8 1 502.09397952 0.MUMSUNI Dependent Variable ht Covariance Structure Toeplitz Subject Effect plt(blk*chem) Estimation Method REML Residual Variance Method Profile Fixed Effects SE Method Prasad-Rao-Jeske-Kackar-Harville Degrees of Freedom Method Kenward-Roger Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 669.63720490 0. repeated time / sub=plt(chem time) type=toep r rcorr.5889640 3 1 508.26590893 999. The Mixed Procedure Model Information Data Set WORK. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses Selecting a Covariance Structure Another covariance structure that is often useful is the Toeplitz structure. proc mixed data=mumsuni.00000000 Convergence criteria met. . model ht = chem time chem*time / ddfm=kr.48842706 4 1 505.30158009 3121.63704334 0.02318228 5 3 503.66411897 0.21399990 1 2 521.00016872 7 1 502.229199 2 1 514.47449670 0.00247659 6 1 502.

1461 8.1461 9.6535 0.0547 19.6535 0.6 for toep.3033 22.7663 7. both larger than for arh(1).4120 9.4120 9. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses Selecting a Covariance Structure Estimated R Matrix for plt(blk*chem) 1 1 bonzi Row Col1 Col2 Col3 Col4 Col5 Col6 1 22. .3033 6 8.3033 22.0547 19.0547 19.4120 19.7663 14.3240 0.0000 0. but the covariance matrices are quite different due to heterogeneous variances.3033 14.6535 0.8752 1.4428 0.6535 0.7663 14.4120 9.6 AIC (smaller is better) 514.4060 2 0.4428 0.6535 5 0.0000 Fit Statistics -2 Res Log Likelihood 502.3033 14.9552 7.0547 19.6 AICC (smaller is better) 515.7663 7.4428 0.4428 0.3033 14.3033 14.0000 0.8752 0.4120 19.3240 3 0.4120 19.8752 0. This indicates using the arh(1) covariance structure.8752 1.3033 22.7663 4 9.0000 0.3033 22.0000 0.3240 0.3240 0.8752 0.0547 19.1461 3 14.8752 1.8752 6 0.6535 0.6 Interpretation: The “toep” and “unstructured” correlation matrices are similar.4120 19.4428 0.8752 1.6535 0. which are not accommodated by “toep.7663 14.4428 4 0.3033 22.8752 1.6535 0.4120 5 7.0547 Estimated R Correlation Matrix for plt(blk*chem) 1 1 bonzi Row Col1 Col2 Col3 Col4 Col5 Col6 1 1.5 BIC (smaller is better) 520.4060 0.0000 0.” The AICC fit index is 515.9552 2 19.1461 9.8752 0.5 and the BIC fit index is 520.

(s.3636 18. estimate 'b-s time6' trt 1 -1 trt*time 0 0 0 0 0 1 0 0 0 0 0 -1. Estimates Label Estimate Standard DF t Value Pr > |t| Error bonzi-sumag 2.5237 b-s time3 -0.48 .45 .1393 b-s time1 -0. estimate 'b-s time2' trt 1 -1 trt*time 0 1 0 0 0 0 0 -1 0 0 0 0.9262 b-s time4 2.30) 6.24) MIXED Chem p-value .65 0.0596 b-s time6 6. proc mixed data=mumsuni.35(.80(2.6025 18. model ht = chem time chem*time / ddfm=kr.4609 17.36) 5.5 -0. estimate 'b-s time3' trt 1 -1 trt*time 0 0 1 0 0 0 0 0 -1 0 0 0.5 2.07) 2. estimate 'b-s time4' trt 1 -1 trt*time 0 0 0 1 0 0 0 0 0 -1 0 0. (s.10000 1.51 .44) -0.03 Diff. differences between the growth retardants at each time are of interest.9500 2.85(2.24 .30(.46) -0.09 0. For this example.95(3.97) 6.4582 17.52 . repeated time / sub=plt(chem time) type=arh(1).) -0.6 1.6 2.46) -0.54 0.3500 0.3000 0.36) 5. Effect on growth regulators on chrysanthemum plants Data courtesy James Barrett and Terril Nell Mixed Model Repeated Measures Analyses The next step is to use the selected covariance structure and compute inferential statistics.10(1.06 . estimate 'b-s time1' trt 1 -1 trt*time 1 0 0 0 0 0 -1 0 0 0 0 0.4750 1.4 -0.e.95(2.85(2.4 -0.30(.80(3.2433 b-s time5 5.4552 b-s time2 -0.8000 2.10(1.00 0.48) -0. class blk chem plt time.21 0. estimate 'bonzi-sumag' chem 1 -1.06 Diff.06) 2.85) . estimate 'b-s time5' trt 1 -1 trt*time 0 0 0 0 1 0 0 0 0 0 -1 0.76 0.38 0.25 .92 .10 .0268 Comparison of inferential results with ANOVA at each time: Time 1 2 3 4 5 6 ANOVA Chem p-value .9759 19.3 1.) -0.8513 20.0643 17.e.93 .35(.8500 2.