Simple Repeated measures
Peter T. Donnan
Professor of Epidemiology and Biostatistics
Statistics for Health Statistics for Health ResearchResearch
Objectives of sessionObjectives of session
• Understand what is meant by Understand what is meant by repeated measuresrepeated measures
• Be able to set out data in Be able to set out data in required formatrequired format
• Carry out simple analyses in Carry out simple analyses in SPSSSPSS
• Interpret the outputInterpret the output
• Understand what is meant by Understand what is meant by repeated measuresrepeated measures
• Be able to set out data in Be able to set out data in required formatrequired format
• Carry out simple analyses in Carry out simple analyses in SPSSSPSS
• Interpret the outputInterpret the output
Repeated MeasuresRepeated Measures
Repeated Measures arise when: Repeated Measures arise when: • Measuring the same Measuring the same
experimental unit (cell, rat, experimental unit (cell, rat, patient) on a number of patient) on a number of occasionsoccasions
• Standard analysis of variance Standard analysis of variance notnot valid as assumes valid as assumes independent measuresindependent measures
• Essentially measurements are Essentially measurements are paired or correlatedpaired or correlated
Repeated Measures arise when: Repeated Measures arise when: • Measuring the same Measuring the same
experimental unit (cell, rat, experimental unit (cell, rat, patient) on a number of patient) on a number of occasionsoccasions
• Standard analysis of variance Standard analysis of variance notnot valid as assumes valid as assumes independent measuresindependent measures
• Essentially measurements are Essentially measurements are paired or correlatedpaired or correlated
Examples of Repeated Examples of Repeated MeasuresMeasures
• Measuring glucose uptake by Measuring glucose uptake by cells at different time points, cells at different time points, under different stimuli, etc.under different stimuli, etc.
• Measuring cholesterol in a Measuring cholesterol in a randomised controlled trial of a randomised controlled trial of a new statin at 3, 6 and 12 monthsnew statin at 3, 6 and 12 months
• Implementing weight loss Implementing weight loss intervention and measuring intervention and measuring weight at different time pointsweight at different time points
• Measuring glucose uptake by Measuring glucose uptake by cells at different time points, cells at different time points, under different stimuli, etc.under different stimuli, etc.
• Measuring cholesterol in a Measuring cholesterol in a randomised controlled trial of a randomised controlled trial of a new statin at 3, 6 and 12 monthsnew statin at 3, 6 and 12 months
• Implementing weight loss Implementing weight loss intervention and measuring intervention and measuring weight at different time pointsweight at different time points
Analysis of Analysis of Repeated MeasuresRepeated Measures
• T-test at each time point very common – T-test at each time point very common – multiple t-testsmultiple t-tests
• Least valid analysis!Least valid analysis!• Primary hypothesis is usually a single test Primary hypothesis is usually a single test
of overall effectof overall effect• By testing at each time point we are By testing at each time point we are
increasing the type I error increasing the type I error • P=0.05 means that we would reject the null P=0.05 means that we would reject the null
hypothesis incorrectly on 1 in 20 occasionshypothesis incorrectly on 1 in 20 occasions• If we keep testing we will eventually find a If we keep testing we will eventually find a
significant result!significant result!
• T-test at each time point very common – T-test at each time point very common – multiple t-testsmultiple t-tests
• Least valid analysis!Least valid analysis!• Primary hypothesis is usually a single test Primary hypothesis is usually a single test
of overall effectof overall effect• By testing at each time point we are By testing at each time point we are
increasing the type I error increasing the type I error • P=0.05 means that we would reject the null P=0.05 means that we would reject the null
hypothesis incorrectly on 1 in 20 occasionshypothesis incorrectly on 1 in 20 occasions• If we keep testing we will eventually find a If we keep testing we will eventually find a
significant result!significant result!
Repeated Measures Could perform t-test at each time
point
Analysis of Analysis of Repeated MeasuresRepeated Measures
• Sometimes account for multiple testing Sometimes account for multiple testing by adjusting p-value i.e. 0.05/k with k by adjusting p-value i.e. 0.05/k with k teststests
• Known as the Bonferoni correctionKnown as the Bonferoni correction• Multiple tests assumes that aim of Multiple tests assumes that aim of
study is to show significant difference study is to show significant difference at at everyevery time point time point
• Most studies aim to show OVERALL Most studies aim to show OVERALL difference between treatments and /or difference between treatments and /or reaching therapeutic target quickerreaching therapeutic target quicker
• PRIMARY HYPOTHESIS IS GLOBALPRIMARY HYPOTHESIS IS GLOBAL
• Sometimes account for multiple testing Sometimes account for multiple testing by adjusting p-value i.e. 0.05/k with k by adjusting p-value i.e. 0.05/k with k teststests
• Known as the Bonferoni correctionKnown as the Bonferoni correction• Multiple tests assumes that aim of Multiple tests assumes that aim of
study is to show significant difference study is to show significant difference at at everyevery time point time point
• Most studies aim to show OVERALL Most studies aim to show OVERALL difference between treatments and /or difference between treatments and /or reaching therapeutic target quickerreaching therapeutic target quicker
• PRIMARY HYPOTHESIS IS GLOBALPRIMARY HYPOTHESIS IS GLOBAL
Simple general Simple general approachapproach
• Basically just an extension of Basically just an extension of analysis of variance (ANOVA)analysis of variance (ANOVA)
• Pairing or matching of Pairing or matching of measurements on same unit measurements on same unit needs to be taken into accountneeds to be taken into account
• Method is General Linear Model Method is General Linear Model for continuous measures and for continuous measures and adjusts tests for correlationadjusts tests for correlation
• Basically just an extension of Basically just an extension of analysis of variance (ANOVA)analysis of variance (ANOVA)
• Pairing or matching of Pairing or matching of measurements on same unit measurements on same unit needs to be taken into accountneeds to be taken into account
• Method is General Linear Model Method is General Linear Model for continuous measures and for continuous measures and adjusts tests for correlationadjusts tests for correlation
Organisation of data Organisation of data (1)(1)
Generally each unit in one row and repeated measures in separate Generally each unit in one row and repeated measures in separate columns columns
Unit Score 1 Score2 Score3 1 2.8 3.1 4.1
2 5.6 5.7 5.1
3 4.3 4.1 5.4
….
Generally each unit in one row and repeated measures in separate Generally each unit in one row and repeated measures in separate columns columns
Unit Score 1 Score2 Score3 1 2.8 3.1 4.1
2 5.6 5.7 5.1
3 4.3 4.1 5.4
….
Organisation of data Organisation of data (2)(2)
Note most other programs and later Note most other programs and later analyses require ONE row per analyses require ONE row per measurement measurement
Note most other programs and later Note most other programs and later analyses require ONE row per analyses require ONE row per measurement 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…….
Basal Insulin Palmitate Insul+Palm Cell type
Exper.
12.41 19.37 5.00 9.88 1 1
14.95 15.84 10.08 8.99 1 1
14.20 19.04 9.63 11.28 1 1
11.96 16.78 13.16 12.46 1 2
.. ….. … … 1 2
Glucose uptake of two cell types (liver and muscle). Each cell challenged with four different ‘treatments’
Data given in ‘Glucose uptake.sav’Note: cell type is a fixed BETWEEN CELL factor‘Treatments’ are REPEATED WITHIN CELL factors
Repeated Measures in Repeated Measures in SPSSSPSS
• Simplest method in SPSS is: Simplest method in SPSS is: • General Linear ModelGeneral Linear Model
Repeated Repeated MeasuresMeasures
• Note many other methods in Note many other methods in SPSS – Mixed Models SPSS – Mixed Models described on day 4described on day 4
• Simplest method in SPSS is: Simplest method in SPSS is: • General Linear ModelGeneral Linear Model
Repeated Repeated MeasuresMeasures
• Note many other methods in Note many other methods in SPSS – Mixed Models SPSS – Mixed Models described on day 4described on day 4
Repeated Measures in SPSS: Set factor and number of levels
Within Within subject factorsubject factor
Within Within subject subject factor levelsfactor levels
Within subject Within subject factor namefactor name
Repeated Measures in SPSS: Enter columns of repeated measures
Use arrow to Use arrow to enter each enter each repeated repeated measure measure columncolumn
Between Between subject factor subject factor columncolumn
Repeated Measures in SPSS:
Select options
Use arrow to Use arrow to select display select display of means and of means and Bonferroni Bonferroni corrected corrected comparisonscomparisons
Select other Select other optionsoptions
Select a Select a plot of plot of means means of each of each within within subject subject treatmetreatmentnt
Repeated Measures in SPSS: Select options
Repeated Measures in SPSS: Output - Mean glucose uptake
Means for Means for four four treatmenttreatments and s and 95% CI95% CI
1 = Basal; 2 = Insulin; 1 = Basal; 2 = Insulin; 3 = Palmitate; 4 = 3 = Palmitate; 4 = Insulin+Palmitate Insulin+Palmitate
Estimates
Measure: treat
9.617 .911 7.732 11.502
13.026 1.155 10.636 15.415
7.538 .525 6.453 8.623
8.420 .685 7.004 9.837
f actor11
2
3
4
Mean Std. Error Lower Bound Upper Bound
95% Conf idence Interval
Basal Insulin Palmitate Basal Insulin Palmitate Insulin+Palmitate Insulin+Palmitate
Repeated Measures in SPSS: Output – Plot of Mean glucose uptake
Repeated Measures in SPSS: Output – Comparisons of
Mean glucose uptake
ComparisComparison of on of means means with with BonferronBonferroni i correctiocorrectionn
1 = Basal; 2 = Insulin; 1 = Basal; 2 = Insulin; 3 = Palmitate; 4 = 3 = Palmitate; 4 = Insulin+Palmitate Insulin+Palmitate
Pairwise Comparisons
Measure: treat
-3.409* .637 .000 -5.249 -1.569
2.079 .723 .051 -.007 4.164
1.196 .873 1.000 -1.325 3.717
3.409* .637 .000 1.569 5.249
5.488* 1.013 .000 2.563 8.413
4.605* 1.015 .001 1.677 7.534
-2.079 .723 .051 -4.164 .007
-5.488* 1.013 .000 -8.413 -2.563
-.882 .741 1.000 -3.022 1.257
-1.196 .873 1.000 -3.717 1.325
-4.605* 1.015 .001 -7.534 -1.677
.882 .741 1.000 -1.257 3.022
(J) f actor12
3
4
1
3
4
1
2
4
1
2
3
(I) factor11
2
3
4
MeanDif f erence
(I-J) Std. Error Sig.a
Lower Bound Upper Bound
95% Conf idence Interv al forDif f erence
a
Based on estimated marginal means
The mean dif f erence is signif icant at the .05 lev el.*.
Adjustment f or multiple comparisons: Bonf erroni.a.
Repeated Measures:Repeated Measures:ConclusionConclusion
• Energy intake significantly Energy intake significantly higher with insulin compared higher with insulin compared to all other treatmentsto all other treatments
• Addition of palmitate Addition of palmitate removes this effectremoves this effect
• Energy intake significantly Energy intake significantly higher with insulin compared higher with insulin compared to all other treatmentsto all other treatments
• Addition of palmitate Addition of palmitate removes this effectremoves this effect
Mauchley’s Sphericity Mauchley’s Sphericity testtest
• Sphericity refers to the issue Sphericity refers to the issue of the similarity (homogeneity) of of the similarity (homogeneity) of variances in the variances in the differencesdifferences between between
treatmentstreatmentsThink of it as an extension to assumption Think of it as an extension to assumption
in ANOVA of similar variancesin ANOVA of similar variances• It is an assumption of SPSS Repeated It is an assumption of SPSS Repeated
Measures i.e. Measures i.e.
ss22a-ba-b ~ s ~ s22
a-ca-c ~ s ~ s22a-da-d ~ s ~ s22
b-cb-c ~ s ~ s22b-db-d ~ s ~ s22
c-dc-d
• Sphericity refers to the issue Sphericity refers to the issue of the similarity (homogeneity) of of the similarity (homogeneity) of variances in the variances in the differencesdifferences between between
treatmentstreatmentsThink of it as an extension to assumption Think of it as an extension to assumption
in ANOVA of similar variancesin ANOVA of similar variances• It is an assumption of SPSS Repeated It is an assumption of SPSS Repeated
Measures i.e. Measures i.e.
ss22a-ba-b ~ s ~ s22
a-ca-c ~ s ~ s22a-da-d ~ s ~ s22
b-cb-c ~ s ~ s22b-db-d ~ s ~ s22
c-dc-d
Meeting conditions of repeated measures: Mauchly
Sphericity TestP-value P-value for test of for test of SphericitySphericity
Significant so need to correct F Significant so need to correct F test by multiplying degrees of test by multiplying degrees of freedom by Greenhouse-Geisser freedom by Greenhouse-Geisser epsilonepsilon
Mauchly's Test of Sphericityb
Measure: treat
.544 13.208 5 .022 .739 .822 .333Within Subjects Ef fectf actor1
Mauchly 's WApprox.
Chi-Square df Sig.Greenhouse-Geisser Huynh-Feldt Lower-bound
Epsilona
Tests the null hypothesis that the error covariance matrix of the orthonormalized transf ormed dependent variables isproportional to an identity matrix.
May be used to adjust the degrees of f reedom for the averaged tests of signif icance. Corrected tests are display ed inthe Tests of Within-Subjects Ef fects table.
a.
Design: Intercept Within Subjects Design: f actor1
b.
Meeting conditions of repeated measures: Use
corrected p-value if significant non-sphericityOutput Output
gives four gives four different different teststests
Overall test of differences Overall test of differences between treatments within between treatments within subjects: Use Greenhouse-subjects: Use Greenhouse-Geisser corrected p-valueGeisser corrected p-value
Tests of Within-Subjects Effects
Measure: treat
416.883 3 138.961 16.169 .000
416.883 2.218 187.963 16.169 .000
416.883 2.465 169.115 16.169 .000
416.883 1.000 416.883 16.169 .001
592.991 69 8.594
592.991 51.012 11.625
592.991 56.697 10.459
592.991 23.000 25.782
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sourcef actor1
Error(f actor1)
Type I II Sumof Squares df Mean Square F Sig.
AlternativesAlternatives
• When Sphericity is not met an When Sphericity is not met an alternative to the correction alternative to the correction factors is to use MANOVAfactors is to use MANOVA
• Unfortunately this has less Unfortunately this has less power than the Repeated power than the Repeated Measures analysis Measures analysis demonstrated and so should demonstrated and so should generally be avoidedgenerally be avoided
• When Sphericity is not met an When Sphericity is not met an alternative to the correction alternative to the correction factors is to use MANOVAfactors is to use MANOVA
• Unfortunately this has less Unfortunately this has less power than the Repeated power than the Repeated Measures analysis Measures analysis demonstrated and so should demonstrated and so should generally be avoidedgenerally be avoided
Repeated Measures in Repeated Measures in SPSS:SPSS:
Output – Pedometer Trial Output – Pedometer Trial • Randomised controlled trial in Randomised controlled trial in
sedentary elderly womensedentary elderly women• Three groups Three groups
Pedometer+advice, Advice Pedometer+advice, Advice only, Controlonly, Control
• Physical activity measured on Physical activity measured on three occasions three occasions
• 1 – baseline; 1 – baseline; • 2 - 3 mnths; 2 - 3 mnths; • 3 – 9 mnths 3 – 9 mnths
Repeated Measures in SPSS:
Output – Pedometer Trial
0 = Control; 1 = Pedometer+advice0 = Control; 1 = Pedometer+adviceFactor 1 – time baseline, 3 mnths, 9 Factor 1 – time baseline, 3 mnths, 9 mnths mnths
Pedometer Group * factor1Measure: Physical Activity Pedometer factor1 Mean Std. Error 95%CIgroup 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.
Pedometer Group * factor1Measure: Physical Activity Pedometer factor1 Mean Std. Error 95%CIgroup 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.
Repeated Measures in SPSS: Output – Plot of Mean Activity over
time
Repeated Measures in SPSS: Output – Tests of significance
Not quite significant!Not quite significant!
Repeated Measures:Repeated Measures:ConclusionConclusion
• Activity Activity increased increased with with pedometer + pedometer + advice but advice but rise was rise was greatest in greatest in Advice only Advice only groupgroup
• Activity Activity increased increased with with pedometer + pedometer + advice but advice but rise was rise was greatest in greatest in Advice only Advice only groupgroup
Repeated Measures:Repeated Measures:ConclusionConclusion
• Simple repeated measures is Simple repeated measures is useful analysis for overall effectuseful analysis for overall effect
• Avoid multiple testing at each Avoid multiple testing at each time pointtime point
• Check assumption of SphericityCheck assumption of Sphericity• Use adjusted Greenhouse-Use adjusted Greenhouse-
Geisser or Huynh-Feldt Geisser or Huynh-Feldt adjustment if sphericity not metadjustment if sphericity not met
• Later demonstrate mixed model Later demonstrate mixed model
• Simple repeated measures is Simple repeated measures is useful analysis for overall effectuseful analysis for overall effect
• Avoid multiple testing at each Avoid multiple testing at each time pointtime point
• Check assumption of SphericityCheck assumption of Sphericity• Use adjusted Greenhouse-Use adjusted Greenhouse-
Geisser or Huynh-Feldt Geisser or Huynh-Feldt adjustment if sphericity not metadjustment if sphericity not met
• Later demonstrate mixed model Later demonstrate mixed model
ReferencesReferences
Field A. A bluffers guide to …Sphericity. Field A. A bluffers guide to …Sphericity. J Educational Statistics 13(3): 215-226.J Educational Statistics 13(3): 215-226.
Pallant J. SPSS Survival Manual 3Pallant J. SPSS Survival Manual 3rdrd ed, Open University ed, Open University Press, 2007.Press, 2007. Field A. Field A. Discovering Statistics using SPSS for WindowsDiscovering Statistics using SPSS for Windows. . Sage publications, London, 2000.Sage publications, London, 2000. Foster JJFoster JJ. Data Analysis using SPSS for Windows . Data Analysis using SPSS for Windows (Versions 8 – 10)(Versions 8 – 10). Sage publications, London, 2001.. Sage publications, London, 2001. Puri BK. SPSS in practice. An illustrated guide. Arnold, Puri BK. SPSS in practice. An illustrated guide. Arnold, London, 2002.London, 2002.
Repeated Measures: Repeated Measures: Practical in SPSSPractical in SPSS
• Previous analysis lumped all Previous analysis lumped all cells togethercells together
• Two types: liver and muscleTwo types: liver and muscle• 1) Repeat the analysis 1) Repeat the analysis
separately for each cell typeseparately for each cell type• 2) Then compare results from 2) Then compare results from
two types in single analysistwo types in single analysis• Is cell type within subject or Is cell type within subject or
between subject factor?between subject factor?
• Previous analysis lumped all Previous analysis lumped all cells togethercells together
• Two types: liver and muscleTwo types: liver and muscle• 1) Repeat the analysis 1) Repeat the analysis
separately for each cell typeseparately for each cell type• 2) Then compare results from 2) Then compare results from
two types in single analysistwo types in single analysis• Is cell type within subject or Is cell type within subject or
between subject factor?between subject factor?
Repeated Measures: Repeated Measures: Practical in SPSSPractical in SPSS
• Hint - To do separate analysis by Hint - To do separate analysis by cell type use:cell type use:
• Data Data Select Cases Select Cases
(If celltype = 1 or 2) (If celltype = 1 or 2) OROR• DataData
Split file Split file (compare groups by celltype)(compare groups by celltype)
• Hint - To do separate analysis by Hint - To do separate analysis by cell type use:cell type use:
• Data Data Select Cases Select Cases
(If celltype = 1 or 2) (If celltype = 1 or 2) OROR• DataData
Split file Split file (compare groups by celltype)(compare groups by celltype)
Repeated Measures: Practical in Repeated Measures: Practical in SPSSSPSS
SPSS Study database.savSPSS Study database.sav
• Trial of pedometers in elderly Trial of pedometers in elderly sedentary womensedentary women
• Try repeated measures of Try repeated measures of Accelerometer trial dataAccelerometer trial data
• Baseline, 3 months and 9 monthsBaseline, 3 months and 9 months• AccelVM1a, AccelVM2, AccelVM3AccelVM1a, AccelVM2, AccelVM3• Trial arms Ran_grp (1,2,3)Trial arms Ran_grp (1,2,3)• Try adjusting for Age, Try adjusting for Age,
StairsDifficult, SIMDStairsDifficult, SIMD
• Trial of pedometers in elderly Trial of pedometers in elderly sedentary womensedentary women
• Try repeated measures of Try repeated measures of Accelerometer trial dataAccelerometer trial data
• Baseline, 3 months and 9 monthsBaseline, 3 months and 9 months• AccelVM1a, AccelVM2, AccelVM3AccelVM1a, AccelVM2, AccelVM3• Trial arms Ran_grp (1,2,3)Trial arms Ran_grp (1,2,3)• Try adjusting for Age, Try adjusting for Age,
StairsDifficult, SIMDStairsDifficult, SIMD
Top Related