Lecture 6: Repeated Measures Analyses Elizabeth Garrett Child Psychiatry Research Methods Lecture Series
Outline for Today Overview ANOVA models Repeated Measures ANOVA Longitudinal Data Analysis
Overview Linear and logistic regression thus far: –assume each individual has one observation –e.g. one exposure one outcome –can’t go back and “unexpose” the individual and see what happens Practically, –useful to do “experiments” with more than one exposure and more than one outcome per individual –each individual serves as his own control –much “tighter” design in terms of variability –this is called “repeated measures:” the outcome is observed on the same individual at multiple times under different conditions. Generalization of repeated measures: longitudinal analysis –observe multiple outcomes on the same individual at different times –might be observational or experimental –exposure/treatment may or may not vary at different times.
ANOVA models ANOVA = analysis of variance (bad name!) A simple case of linear regression –continuous outcome –categorical dependent variable(s) Why do we hear about ANOVA so often if it is just a special case of linear regression? –Historically, very popular because….easy to perform WITHOUT a computer! –Very prevalent in psychometrics –Interpretation is nice and simple –In its simplest form, an ANOVA represents a generalization of the two sample t-test. It allows for the testing of more than two groups. –Tests to see if means in all groups are equal. –Instead of t-statistic, we look at F-statistic
ANOVA for Independent Observations Example: Drug Study of Hyperactivity in Children under Age observations on children with hyperactivity. Hyperactivity (H) measured by a “scale” instrument –range is 0 to 30 –child is designated as “hyperactive” if score > 15 –to enter the study, must score > 20 3 Treatments: 60 placebo, 60 ritalin, 60 “new” drug. Evaluation based on hyperactivity score (H) measured at study end (2 weeks). Questions: –Do all three treatments have approximately the same effect? –Is the new drug better than placebo? –Is the new drug as good as ritalin?
Intuitive approach Estimate mean H in each group: – p = mean of H in the placebo group – r = mean of H in the ritalin group – n = mean of H in the new drug group Test if the means are the same or different –H 0 : group means are all the same –H 1 : at least one group mean is different than some other group mean.
Nice thing about ANOVA models….. 0 is the estimated score for kids on placebo 1 is the “treatment” effect of ritalin 2 is the “treatment” effect of the new drug 1 - 2 is the difference in effect between ritalin and the new drug
Hyperactivity Example Results Source | SS df MS Number of obs = F( 2, 177) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = H | Coef. Std. Err. t P>|t| [95% Conf. Interval] Itrt_2 | Itrt_3 | _cons |
ANOVA Table Number of obs = 180 R-squared = Root MSE = Adj R-squared = Source | Partial SS df MS F Prob > F Model | | trt | | Residual | Total |
Answers to scientific questions 1. Do all three treatments have approximately the same effect? 2. Is new drug better than placebo? 3. Is the new drug as good as ritalin? No. There is evidence that the intercept alone is not sufficient for describing variability. Why? Pvalue on Fstatistic < Yes. Treatment effect is Why? Pvalue on 2 is less than No. The treatment effect difference is 2.5 Why? Pvalue on 2 - 1 is less than 0.001***
Repeated Measures What happens when we have more than one treatment per individual? Most often “experiments” and not “observational” studies Need special methods –each individual is considered more than once –observations from the same person are likely to be correlated Example: –Consider two kids: One has placebo score of 20 and other has placebo score of 30. –Child with the LOW placebo score also likely to have a LOW ritalin score. –Child with the HIGH placebo score also likely to have a HIGH ritalin score. è Observations from the same child are CORRELATED. è Independence assumption of linear regression is violated.
Repeated Measures Example: Drug Study of Hyperactivity in Children under Age observations on 60 children with hyperactivity. 3 Treatments: placebo, ritalin, “new” drug. Each child receives one of treatments at times 1,2, and 3. Order of treatments is random There is sufficient “wash out” period between treatments to minimize “carry over” effects Evaluation based on hyperactivity score (H) measured at study end (2 weeks). Questions: –Do all three treatments have approximately the same effect? –Is the new drug better than placebo? –Is the new drug as good as ritalin?
Repeated Measures ANOVA Results Source | SS df MS Number of obs = F( 61, 118) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = H | Coef. Std. Err. z P>|z| [95% Conf. Interval] Itrt_2 | Itrt_3 | _cons |
ANOVA Table Root MSE = Adj R-squared = Source | Partial SS df MS F Prob > F Model | | id | trt | | Residual | Total |
So where is the difference?
Answers to scientific questions 1. Do all three treatments have approximately the same effect? 2. Is new drug better than placebo? 3. Is the new drug as good as ritalin? No. There is evidence that the intercept alone is not sufficient for describing variability. Why? Pvalue on Model Fstatistic < Yes. Treatment effect is Why? Pvalue on 2 is less than No. The treatment effect difference is 2.5 Why? Pvalue on 2 - 1 is less than 0.001***
Other issues in repeated measures ANOVA “ Period” Effects Example: –Children screened into study if H > 20. –It is likely that, if we didn’t give them anything, on average, the H scores would go down –This phenomenon is called “regression to the mean” Why is this an issue? –We might expect all kids at time 1 to be “worse” than at other time periods. –We need to adjust for the “period” in which drug was given. Related issue: “Carry over” effects –In many studies, the treatment might be curative or at least long-lasting. –If an individual is cured by a treatment at time 1, we would not want to attribute his effect to placebo at time 2. –In addition to adjustment (as we will see in a minute), it is important to consider building a “wash out” period into cross-over designs.
Period Adjustment
Source | SS df MS Number of obs = F( 63, 116) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = H | Coef. Std. Err. z P>|z| [95% Conf. Interval] Itrt_2 | Itrt_3 | Itime_2 | Itime_3 | _cons | Repeated Measures ANOVA Results
ANOVA Table Number of obs = 180 R-squared = Root MSE = Adj R-squared = Source | Partial SS df MS F Prob > F Model | | id | trt | time | | Residual | Total |
Answers to scientific questions 1. Do all three treatments have approximately the same effect? 2. Is new drug better than placebo? 3. Is the new drug as good as ritalin? No. There is evidence that the intercept alone is not sufficient for describing variability. Why? Pvalue on Fstatistic < Yes. Treatment effect is Why? Pvalue on 2 is less than No. The treatment effect difference is 2.4 Why? Pvalue on 2 - 1 is less than 0.001****
Is that it? Not quite….. Interactions! Is it possible that the effect of treatment is different at different times? Current model: forces treatment effects to be the same across all time periods. Why might this not be okay? –What if the kids would get “better” by time period 3 anyway? (Think about diseases/disorders which have “flares”, e.g. depression, herpes). Interactions allow more flexibility in the model They allow the treatment effects to be different at different times.
“Full blown” model
Including Interactions
How do we measure treatment effects? Now that we have interactions, 1 is not “treatment effect” of ritalin and 2 is not “treatment effect” effect of new drug For ritalin: – 1 is the treatment effect of ritalin at time 1 – 1 + 5 is the treatment effect of ritalin at time 2 – 1 + 7 is the treatment effect of ritalin at time 3 For new drug: – 2 is the treatment effect of new drug at time 1 – 2 + 6 is the treatment effect of new drug at time 2 – 2 + 8 is the treatment effect of new drug at time 3
Are they significant? Source | SS df MS Number of obs = F( 67, 112) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = H | Coef. Std. Err. z P>|z| [95% Conf. Interval] Itrt_2 | Itrt_3 | Itime_2 | Itime_3 | ItXt_2_2 | ItXt_2_3 | ItXt_3_2 | ItXt_3_3 | _cons |
Need another F-test Number of obs = 180 R-squared = Root MSE = Adj R-squared = Source | Partial SS df MS F Prob > F Model | | id | trt | time | trt*time | | Residual | Total |
Answers to scientific questions 1. Do all three treatments have approximately the same effect? 2. Is new drug better than placebo? 3. Is the new drug as good as ritalin? No. There is evidence that the intercept alone is not sufficient for describing variability. Why? Pvalue on Fstatistic < Yes. Treatment effects are -9.5,-7.8,-7.6. Why? Pvalue on 2 is less than 0.001*** No. The treatment effect differences are -2.5,-1.8,-2.9 Why? Pvalue on differences are less than 0.05.
Longitudinal Analyses Repeated measures ANOVA is a simple case of a longitudinal analysis In longitudinal analysis: –can be observational or experimental study –the observations can be at random times (need not be at time 1, time 2, and time 3 as previously.) –Generally, time is an important component of the study.
New example: Depression in adults Due to the episodic nature of depression, if an individual is in a depressive episode today, s/he is likely to not be in one in 8 weeks Evaluation of anti-depressants can be difficult for that reason. In evaluation of treatments, we care about not only IF a treatment works, but HOW SOON it works.
Clinical Trial of Paroxetine (hypothetical) 200 individuals blindly randomized to receive either paroxetine or placebo beginning at week 0. Subjects are screened at week -1 and have to score at least 22 on Hamilton D depression scale. Subjects are followed for 8 weeks with evaluations at weeks 0 (baseline), 1, 2, 4, 6, 8. Outcome measure is Hamilton D score. Questions: –Is paroxetine more effective than placebo? –Do individuals tend to improve more quickly on paroxetine versus placebo?
Change in HamD score from week 0 to week 6 If we stopped here, we would conclude that the drug was useless! Change in
Look at data over time….
Random Effects Models Assumes that an individual has his/her own “intercept”/”effect”. Observations within individuals are correlated. The model estimates intercept for each person, but assumes that individuals have the same slope (within covariate groups) Notice the “i” subscript
Covariates Time: we know that HamD changes over time. To get “curvy” line, we need to include more than just a linear time variable. Paroxetine: we want to see if the paroxetine group differs from the placebo group
Results xtreg y week week2 trt, i(id) Random-effects GLS regression Number of obs = 1200 Group variable (i) : id Number of groups = 200 R-sq: within = Obs per group: min = 6 between = avg = 6.0 overall = max = 6 Random effects u_i ~ Gaussian Wald chi2(3) = corr(u_i, X) = 0 (assumed) Prob > chi2 = y | Coef. Std. Err. z P>|z| [95% Conf. Interval] week | week2 | trt | _cons | sigma_u | sigma_e | rho | (fraction of variance due to u_i)
Results Paroxetine Placebo
Something is wrong with our model!
Problem: We need to let the treatment VARY over time! The approach above simply ADJUSTS for time. We want to see how the relationship differs between treatment groups over time. We need interactions again!
Results. xi: xtreg y i.trt*week i.trt*week2, i(id) y | Coef. Std. Err. z P>|z| [95% Conf. Interval] Itrt_1 | week | week2 | ItXwee_1 | ItXweea1 | _cons |
Results Paroxetine Placebo
References Diggle, Liang, and Zeger (1994) Analysis of Longitudinal Data B.S. Everitt (1995) The analysis of repeated measures: a practical review with examples. The Statistician, 44, pp Crowder and Hand (1990) Analysis of Repeated Measures. D. Elkstrom (1990) Statistical analysis of repeated measures in psychiatric research. Archives of General Psychiatry, 47, pp [ANOVA (for non-repeated measures) is covered in most basic stats books.]