hw9.sol - Page 1 of 10 Stat209/ Ed260 3/9/09 Solutions Week...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Stat209/ Ed260 3/9/09 Solutions Week 9 Exercises: Lord's Paradox, Repeated measures anova, Growth Curves 1. Lord's paradox example Basic idea here is to illustrate the contrast between adressing the descriptive question: who changed? or who changed more? versus the regression adjustment question: how much would have changed if groups started out equal? In methods terms comes down to difference score (repeated measures anova) vs analysis of covariance a. construct a two-group pre-post example with 20 observations in each group that mimics the description in Lord (1967): statistician 1 (difference scores) obtains 0 group effect statistician 2 (analysis of covariance) obtains large group effect for the group higher on the pre-existing differences in pretest > #Lord's paradox exs > # example 1 pub example, no gain, ancova pos male effect set up I used below corr .7 within gender, equal vars time1 time 2 within gender means M F X (t1) 170 120 Y (t2) 170 120 comparison of "gains" 170 - 170 - (120 - 120) = 0 ancova 170 - 120 - .7*(170 - 120) = 15 positive male effect do it > library(MASS) > ?mvrnorm > cov1 = matrix(nrow=2, ncol = 2, c(225, .7*225, .7*225, 225)) > cov1 [,1] [,2] [1,] 225.0 157.5 [2,] 157.5 225.0 > male1dat = mvrnorm(n=20, c(170,170), cov1, empirical = TRUE) > male1dat [,1] [,2] [1,] 152.0206 159.0454 [2,] 160.2532 177.2779 [3,] 167.0927 166.9281 [4,] 189.6583 173.5147 [5,] 174.1266 161.4300 [6,] 183.1530 189.2863 [7,] 152.6184 157.4682 [8,] 155.4107 134.3036 [9,] 156.8543 179.3864 [10,] 162.7649 170.1779 [11,] 179.8723 179.0186 [12,] 192.0060 176.2807 [13,] 170.3942 165.8855 [14,] 170.5667 171.3912 [15,] 204.9177 201.5652 [16,] 170.2353 158.6134 [17,] 158.3600 173.5756 [18,] 185.6572 189.6478 [19,] 154.5156 149.1311 [20,] 159.5224 166.0725 > mean(male1dat[,1]) [1] 170 > mean(male1dat[,2]) [1] 170 > fem1dat = mvrnorm(n=20, c(120,120), cov1, empirical = TRUE) > fem1dat [,1] [,2] [1,] 137.05501 138.20244 [2,] 108.79177 109.10794 [3,] 126.99485 111.86838 [4,] 106.25186 132.77624 [5,] 117.92782 118.47217 [6,] 147.46169 149.53828 [7,] 75.80934 88.72757 Page 1 of 10 06/12/2010 http://www-stat.stanford.edu/~rag/stat209/09hw9.sol
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
[8,] 124.62055 114.59835 [9,] 123.07000 117.97457 [10,] 123.87528 109.91133 [11,] 105.03939 100.12470 [12,] 123.45952 114.12601 [13,] 137.89725 133.54379 [14,] 127.06693 140.66961 [15,] 116.96018 116.83323 [16,] 115.20937 103.49453 [17,] 119.97415 127.11015 [18,] 132.64286 121.51399 [19,] 112.26654 134.84798 [20,] 117.62566 116.55875 > male1reg = lm(male1dat[,2] ~ male1dat[,1]) > coefficients(male1reg) (Intercept) male1dat[, 1] 51.0 0.7 > fem1reg = lm(fem1dat[,2] ~ fem1dat[,1]) > coefficients(fem1reg) (Intercept) fem1dat[, 1] 36.0 0.7 > # difference score estimate--stat1 > mean(male1dat[,2]) - mean(male1dat[,1]) - (mean(fem1dat[,2]) - mean(fem1dat[,1])) [1] 0 > # ancova estimate > mean(male1dat[,2]) - mean(fem1dat[,2]) - .7*(mean(male1dat[,1]) - mean(fem1dat[,1])) [1] 15 > # or do ancova the regression way create ancova dataset and then rename
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

hw9.sol - Page 1 of 10 Stat209/ Ed260 3/9/09 Solutions Week...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online