Statistics for Health Research Simple Repeated measures Peter T. Donnan Professor of Epidemiology and Biostatistics Objectives of session • Understand what is meant by repeated measures • Be able to set out data in required format • Carry out simple analyses in SPSS • Interpret the output Repeated Measures Repeated Measures arise when: • Measuring the same experimental unit (cell, rat, patient) on a number of occasions • Standard analysis of variance not valid as assumes independent measures • Essentially measurements are paired or correlated Examples of Repeated Measures • Measuring glucose uptake by cells at different time points, under different stimuli, etc. • Measuring cholesterol in a randomised controlled trial of a new statin at 3, 6 and 12 months • Implementing weight loss intervention and measuring weight at different time points Analysis of Repeated Measures • T-test at each time point very common – • • • • • multiple t-tests Least valid analysis! Primary hypothesis is usually a single test of overall effect By testing at each time point we are increasing the type I error P=0.05 means that we would reject the null hypothesis incorrectly on 1 in 20 occasions If we keep testing we will eventually find a significant result! Repeated Measures Could perform t-test at each time point Analysis of Repeated Measures • Sometimes account for multiple testing by • • • • adjusting p-value i.e. 0.05/k with k tests Known as the Bonferoni correction Multiple tests assumes that aim of study is to show significant difference at every time point Most studies aim to show OVERALL difference between treatments and /or reaching therapeutic target quicker PRIMARY HYPOTHESIS IS GLOBAL Simple general approach • Basically just an extension of analysis of variance (ANOVA) • Pairing or matching of measurements on same unit needs to be taken into account • Method is General Linear Model for continuous measures and adjusts tests for correlation Organisation of data (1) Generally each unit in one row and repeated measures in separate columns Unit 1 Score 1 2.8 Score2 3.1 Score3 4.1 2 5.6 5.7 5.1 3 4.3 4.1 5.4 …. Organisation of data (2) Note most other programs and later analyses require ONE row per measurement Unit Score Time 1 2.8 1 1 3.1 2 1 4.1 3 2 5.6 1 2 5.7 2 2 5.1 3 3 4.3 1 Etc……. Glucose uptake of two cell types (liver and muscle). Each cell challenged with four different ‘treatments’ Basal Insulin Palmitate 12.41 19.37 5.00 14.95 15.84 14.20 Insul+Palm Cell type Exper. 9.88 1 1 10.08 8.99 1 1 19.04 9.63 11.28 1 1 11.96 16.78 13.16 12.46 1 2 .. ….. … … 1 2 Data given in ‘Glucose uptake.sav’ Note: cell type is a fixed BETWEEN CELL factor ‘Treatments’ are REPEATED WITHIN CELL factors Repeated Measures in SPSS • Simplest method in SPSS is: • General Linear Model Repeated Measures • Note many other methods in SPSS – Mixed Models described on day 4 Repeated Measures in SPSS: Set factor and number of levels Within subject factor Within subject factor levels Within subject factor name Repeated Measures in SPSS: Enter columns of repeated measures Use arrow to enter each repeated measure column Between subject factor column Repeated Measures in SPSS: Select options Use arrow to select display of means and Bonferroni corrected comparisons Select other options Repeated Measures in SPSS: Select options Select a plot of means of each within subject treatment Repeated Measures in SPSS: Output - Mean glucose uptake Estimates Means for four treatments and 95% CI Measure: treat f actor1 1 2 3 4 Mean 9.617 13.026 7.538 8.420 Std. Error .911 1.155 .525 .685 95% Conf idence Interval Lower Bound Upper Bound 7.732 11.502 10.636 15.415 6.453 8.623 7.004 9.837 1 = Basal; 2 = Insulin; 3 = Palmitate; 4 = Insulin+Palmitate Repeated Measures in SPSS: Output – Plot of Mean glucose uptake Basal Insulin Palmitate Insulin+Palmitate Repeated Measures in SPSS: Output – Comparisons of Mean glucose uptake Comparison of means with Bonferroni correction Pairwise Comparison s Measure: treat (I) f actor1 1 2 3 4 (J) f actor1 2 3 4 1 3 4 1 2 4 1 2 3 Mean Dif f erence (I-J) -3.409* 2.079 1.196 3.409* 5.488* 4.605* -2.079 -5.488* -.882 -1.196 -4.605* .882 St d. Error .637 .723 .873 .637 1.013 1.015 .723 1.013 .741 .873 1.015 .741 a Sig. .000 .051 1.000 .000 .000 .001 .051 .000 1.000 1.000 .001 1.000 95% Conf idence Interv al f or a Dif f erence Lower Bound Upper Bound -5.249 -1.569 -.007 4.164 -1.325 3.717 1.569 5.249 2.563 8.413 1.677 7.534 -4.164 .007 -8.413 -2.563 -3.022 1.257 -3.717 1.325 -7.534 -1.677 -1.257 3.022 Based on estimated marginal means *. The mean dif f erence is signif icant at the . 05 lev el. a. Adjustment f or multiple comparisons: Bonf erroni. 1 = Basal; 2 = Insulin; 3 = Palmitate; 4 = Insulin+Palmitate Repeated Measures: Conclusion • Energy intake significantly higher with insulin compared to all other treatments • Addition of palmitate removes this effect Mauchley’s Sphericity test • Sphericity refers to the issue of the similarity (homogeneity) of variances in the differences between treatments Think of it as an extension to assumption in ANOVA of similar variances • It is an assumption of SPSS Repeated Measures i.e. s2a-b ~ s2a-c ~ s2a-d ~ s2b-c ~ s2b-d ~ s2c-d Meeting conditions of repeated measures: Mauchly Sphericity Test P-value for test of Sphericity Mauchly's Test of Sphericityb Measure: treat Epsilon Within Subjects Ef fect Mauchly 's W f actor1 .544 Approx. Chi-Square 13.208 df 5 Sig. .022 Greenhous e-Geisser .739 a Huynh-Feldt .822 Lower-bound .333 Tests the null hypothesis that the error covariance matrix of the orthonormalized transf ormed dependent variables is proportional to an identity matrix. a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected tests are display ed in the Tests of Within-Subjects Ef fects table. b. Design: Intercept Within Subjects Design: f actor1 Significant so need to correct F test by multiplying degrees of freedom by Greenhouse-Geisser epsilon Meeting conditions of repeated measures: Use corrected p-value if significant non-sphericity Output gives four different tests Tests of Within-Subjects Effects Measure: treat Source f actor1 Error(f actor1) Sphericity Assumed Greenhouse-Geisser Huynh-Feldt Lower-bound Sphericity Assumed Greenhouse-Geisser Huynh-Feldt Lower-bound Type III Sum of Squares 416.883 416.883 416.883 416.883 592.991 592.991 592.991 592.991 df 3 2.218 2.465 1.000 69 51.012 56.697 23.000 Mean Square 138.961 187.963 169.115 416.883 8.594 11.625 10.459 25.782 F 16.169 16.169 16.169 16.169 Overall test of differences between treatments within subjects: Use Greenhouse-Geisser corrected p-value Sig. .000 .000 .000 .001 Alternatives • When Sphericity is not met an alternative to the correction factors is to use MANOVA • Unfortunately this has less power than the Repeated Measures analysis demonstrated and so should generally be avoided Repeated Measures in SPSS: Output – Pedometer Trial • Randomised controlled trial in sedentary elderly women • Three groups Pedometer+advice, Advice only, Control • Physical activity measured on three occasions • 1 – baseline; • 2 - 3 mnths; • 3 – 9 mnths Repeated Measures in SPSS: Output – Pedometer Trial Pedometer Group * factor1 Measure: Physical Activity Pedometer factor1 Mean Std. Error 95%CI group Lower Upper .00 1 126792 4665 117578 136006 2 133619 5089 123568 143669 3 128766 4969 118952 138580 1.00 1 141138a 6520 128262 154015 2 147371a 7111 133326 161417 3 136059a 6944 122344 149773 a. Based on modified population marginal mean. 0 = Control; 1 = Pedometer+advice Factor 1 – time baseline, 3 mnths, 9 mnths Repeated Measures in SPSS: Output – Plot of Mean Activity over time Repeated Measures in SPSS: Output – Tests of significance Not quite significant! Repeated Measures: Conclusion • Activity increased with pedometer + advice but rise was greatest in Advice only group Repeated Measures: Conclusion • Simple repeated measures is • • • • useful analysis for overall effect Avoid multiple testing at each time point Check assumption of Sphericity Use adjusted Greenhouse-Geisser or Huynh-Feldt adjustment if sphericity not met Later demonstrate mixed model References Field A. A bluffers guide to …Sphericity. J Educational Statistics 13(3): 215-226. Pallant J. SPSS Survival Manual 3rd ed, Open University Press, 2007. Field A. Discovering Statistics using SPSS for Windows. Sage publications, London, 2000. Foster JJ. Data Analysis using SPSS for Windows (Versions 8 – 10). Sage publications, London, 2001. Puri BK. SPSS in practice. An illustrated guide. Arnold, London, 2002. Repeated Measures: Practical in SPSS • Previous analysis lumped all cells • • • • together Two types: liver and muscle 1) Repeat the analysis separately for each cell type 2) Then compare results from two types in single analysis Is cell type within subject or between subject factor? Repeated Measures: Practical in SPSS • Hint - To do separate analysis by cell type use: • Data Select Cases (If celltype = 1 or 2) OR • Data Split file (compare groups by celltype) Repeated Measures: Practical in SPSS SPSS Study database.sav • Trial of pedometers in elderly • • • • • sedentary women Try repeated measures of Accelerometer trial data Baseline, 3 months and 9 months AccelVM1a, AccelVM2, AccelVM3 Trial arms Ran_grp (1,2,3) Try adjusting for Age, StairsDifficult, SIMD