Child Psychiatry Research Methods Lecture Series. Lecture 6: Repeated Measures Analyses . Elizabeth Garrett esg@jhu.edu. Outline for Today. Overview ANOVA models Repeated Measures ANOVA Longitudinal Data Analysis. Overview. Linear and logistic regression thus far:
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Child Psychiatry
Research Methods Lecture Series
Lecture 6:Repeated Measures Analyses
Elizabeth Garrett
esg@jhu.edu
Overview
ANOVA models
Repeated Measures ANOVA
Longitudinal Data Analysis
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
H0: group means are all the same
H1: at least one group mean is different than some other group mean.
Source  SS df MS Number of obs = 180
+ F( 2, 177) = 121.53
Model  2213.37778 2 1106.68889 Prob > F = 0.0000
Residual  1611.86667 177 9.10659134 Rsquared = 0.5786
+ Adj Rsquared = 0.5739
Total  3825.24444 179 21.3700807 Root MSE = 3.0177

H  Coef. Std. Err. t P>t [95% Conf. Interval]
+
Itrt_2  8.366667 .5509565 15.186 0.000 9.453956 7.279378
Itrt_3  5.866667 .5509565 10.648 0.000 6.953956 4.779378
_cons  23.1 .3895851 59.294 0.000 22.33117 23.86883

Number of obs = 180 Rsquared = 0.5786
Root MSE = 3.01771 Adj Rsquared = 0.5739
Source  Partial SS df MS F Prob > F
+
Model  2213.37778 2 1106.68889 121.53 0.0000

trt  2213.37778 2 1106.68889 121.53 0.0000

Residual  1611.86667 177 9.10659134
+
Total  3825.24444 179 21.3700807
.
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 < 0.001
Yes. Treatment effect is 8.4.
Why? Pvalue on 2 is less than 0.001
No. The treatment effect difference is 2.5
Why? Pvalue on 2  1 is less than 0.001***
What happens when we have more than one treatment per individual?
Most often “experiments” and not “observational” studies
Need special methods
Example:
Source  SS df MS Number of obs = 180
+ F( 61, 118) = 10.37
Model  3223.95556 61 52.8517304 Prob > F = 0.0000
Residual  601.288889 118 5.09566855 Rsquared = 0.8428
+ Adj Rsquared = 0.7616
Total  3825.24444 179 21.3700807 Root MSE = 2.2574

H  Coef. Std. Err. z P>z [95% Conf. Interval]
+
Itrt_2  8.366667 .4121355 20.301 0.000 9.174437 7.558896
Itrt_3  5.866667 .4121355 14.235 0.000 6.674437 5.058896
_cons  23.1 .3895851 59.294 0.000 22.33643 23.86357
+
Root MSE = 2.25736 Adj Rsquared = 0.7616
Source  Partial SS df MS F Prob > F
+
Model  3223.95556 61 52.8517304 10.37 0.0000

id  1010.57778 59 17.1284369 3.36 0.0000
trt  2213.37778 2 1106.68889 217.18 0.0000

Residual  601.288889 118 5.09566855
+
Total  3825.24444 179 21.3700807
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 < 0.001
Yes. Treatment effect is 8.4.
Why? Pvalue on 2 is less than 0.001
No. The treatment effect difference is 2.5
Why? Pvalue on 2  1 is less than 0.001***
Repeated Measures ANOVA Results
Source  SS df MS Number of obs = 180
+ F( 63, 116) = 11.69
Model  3304.89281 63 52.4586161 Prob > F = 0.0000
Residual  520.35163 116 4.48578991 Rsquared = 0.8640
+ Adj Rsquared = 0.7901
Total  3825.24444 179 21.3700807 Root MSE = 2.118

H  Coef. Std. Err. z P>z [95% Conf. Interval]
+
Itrt_2  8.289234 .3878228 21.374 0.000 9.049352 7.529115
Itrt_3  5.876126 .3892903 15.094 0.000 6.639121 5.113131
Itime_2  .8925736 .3888018 2.296 0.022 1.654611 .1305361
Itime_3  1.643255 .3873324 4.242 0.000 2.402413 .8840976
_cons  23.92262 .4452343 53.730 0.000 23.04998 24.79526
+
Number of obs = 180 Rsquared = 0.8640
Root MSE = 2.11797 Adj Rsquared = 0.7901
Source  Partial SS df MS F Prob > F
+
Model  3304.89281 63 52.4586161 11.69 0.0000

id  1010.57778 59 17.1284369 3.82 0.0000
trt  2163.63726 2 1081.81863 241.17 0.0000
time  80.9372588 2 40.4686294 9.02 0.0002

Residual  520.35163 116 4.48578991
+
Total  3825.24444 179 21.3700807
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 < 0.001
Yes. Treatment effect is 8.3.
Why? Pvalue on 2 is less than 0.001
No. The treatment effect difference is 2.4
Why? Pvalue on 2  1 is less than 0.001****
Source  SS df MS Number of obs = 180
+ F( 67, 112) = 11.72
Model  3347.79611 67 49.9671062 Prob > F = 0.0000
Residual  477.448331 112 4.26293153 Rsquared = 0.8752
+ Adj Rsquared = 0.8005
Total  3825.24444 179 21.3700807 Root MSE = 2.0647

H  Coef. Std. Err. z P>z [95% Conf. Interval]
+
Itrt_2  9.486124 .8174333 11.605 0.000 11.08826 7.883985
Itrt_3  6.954453 .7701922 9.030 0.000 8.464002 5.444904
Itime_2  1.788544 .7639526 2.341 0.019 3.285864 .2912243
Itime_3  3.104565 .82816 3.749 0.000 4.727729 1.481401
ItXt_2_2  1.682091 1.195857 1.407 0.160 .6617452 4.025926
ItXt_2_3  1.904287 1.207546 1.577 0.115 .4624599 4.271034
ItXt_3_2  .9351192 1.203284 0.777 0.437 1.423273 3.293512
ItXt_3_3  2.305485 1.20026 1.921 0.055 .0469805 4.65795
_cons  24.69504 .6075533 40.647 0.000 23.50426 25.88583
Number of obs = 180 Rsquared = 0.8752
Root MSE = 2.06469 Adj Rsquared = 0.8005
Source  Partial SS df MS F Prob > F
+
Model  3347.79611 67 49.9671062 11.72 0.0000

id  1049.02243 59 17.7800412 4.17 0.0000
trt  2110.38776 2 1055.19388 247.53 0.0000
time  89.5774582 2 44.7887291 10.51 0.0001
trt*time  42.9032988 4 10.7258247 2.52 0.0454
Residual  477.448331 112 4.26293153
+
Total  3825.24444 179 21.3700807
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 < 0.001
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.
Change in
If we stopped here, we would conclude that the drug was useless!
Notice the “i” subscript
xtreg y week week2 trt, i(id)
Randomeffects GLS regression Number of obs = 1200
Group variable (i) : id Number of groups = 200
Rsq: within = 0.7288 Obs per group: min = 6
between = 0.4242 avg = 6.0
overall = 0.6090 max = 6
Random effects u_i ~ Gaussian Wald chi2(3) = 2828.24
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

y  Coef. Std. Err. z P>z [95% Conf. Interval]
+
week  1.112177 .0740175 15.026 0.000 1.257249 .9671058
week2  .0126631 .0089831 1.410 0.159 .0049435 .0302697
trt  3.4973 .2895713 12.078 0.000 4.064849 2.92975
_cons  26.22405 .226547 115.755 0.000 25.78003 26.66808
+
sigma_u  1.8942426
sigma_e  1.9043451
rho  .49734047 (fraction of variance due to u_i)

Placebo
Paroxetine
Something is wrong with our model!
. xi: xtreg y i.trt*week i.trt*week2 , i(id)

y  Coef. Std. Err. z P>z [95% Conf. Interval]
+
Itrt_1  .0729227 .1007545 0.724 0.469 .2703978 .1245525
week  .8142721 .0546507 14.900 0.000 .7071588 .9213855
week2  .2294649 .0066327 34.596 0.000 .2424647 .2164651
ItXwee_1  3.852899 .0772877 49.851 0.000 4.00438 3.701418
ItXweea1  .4842559 .00938 51.626 0.000 .4658714 .5026404
_cons  24.36439 .2169079 112.326 0.000 23.93926 24.78952
+
Placebo
Paroxetine
[ANOVA (for nonrepeated measures) is covered in most basic stats books.]