Time1-Time2 regressions Example from Rogosa, D. R. (1995). Myths and methods: "Myths about longitudinal research," plus supplemental questions. In The analysis of change, J. M. Gottman, Ed. Hillsdale, New Jersey: Lawrence Erlbaum Associates, 3-65. > mtruesig$theta = signif((mtrue$Xi5 - mtrue$Xi1)/4,4) > mtruesig Xi1 Xi3 Xi5 W theta > truereg1 = lm(Xi5 ~ W + Xi1) 1 37.56 49.29 61.02 15.970 5.866 > truereg2 = lm(Xi5 ~ W + Xi3) 2 45.65 51.58 57.51 15.380 2.965 > truediffreg = lm(I(Xi5- Xi3) ~ W) 3 40.94 52.88 64.82 11.480 5.970 > summary(truereg1) 4 47.36 55.45 63.54 16.890 4.045 Call: lm(formula = Xi5 ~ W + Xi1) 5 52.71 62.70 72.70 19.180 4.999 Coefficients: 6 30.45 46.34 62.23 11.820 7.944 Estimate Std. Error t value Pr(>|t|) 7 43.65 58.37 73.09 15.330 7.362 (Intercept) 31.2139 7.5445 4.137 0.000194 *** 8 41.16 49.26 57.37 13.210 4.054 W 1.5002 0.6680 2.246 0.030788 * 9 44.15 52.00 59.84 13.090 3.923 Xi1 0.2392 0.2588 0.924 0.361290 10 38.16 46.59 55.03 10.320 4.217 --- 11 37.68 39.87 42.06 10.260 1.096 Residual standard error: 7.514 on 37 degrees of freedom 12 45.30 54.38 63.47 15.600 4.541 Multiple R-squared: 0.3727, Adjusted R-squared: 0.33 13 39.37 48.15 56.94 13.900 4.392 F-statistic: 10.99 on 2 and 37 DF, p-value: 0.0001792 14 36.66 43.75 50.84 13.530 3.544 15 53.40 62.32 71.23 14.450 4.459 > summary(truereg2) 16 59.35 62.80 66.25 20.160 1.724 Call: lm(formula = Xi5 ~ W + Xi3) 17 53.14 64.35 75.56 16.110 5.605 Coefficients: 18 44.90 58.82 72.75 15.060 6.962 Estimate Std. Error t value Pr(>|t|) 19 41.79 59.44 77.09 18.330 8.827 (Intercept) 0.6874 4.5537 0.151 0.8808 20 38.25 48.98 59.71 13.770 5.367 W -0.7570 0.3329 -2.274 0.0289 * 21 47.24 60.79 74.34 15.880 6.776 Xi3 1.3821 0.1290 10.718 6.7e-13 *** 22 53.57 67.71 81.84 18.250 7.068 --- 23 35.54 43.51 51.48 10.150 3.984 Residual standard error: 3.751 on 37 degrees of freedom 24 37.54 50.25 62.95 9.462 6.353 Multiple R-squared: 0.8437, Adjusted R-squared: 0.83 25 37.07 49.71 62.35 15.810 6.321 F-statistic: 99.83 on 2 and 37 DF, p-value: 1.232e-15 26 32.40 44.69 56.98 11.600 6.145 27 45.22 62.08 78.94 14.080 8.430 > summary(truediffreg) 28 35.67 47.42 59.17 12.190 5.875 Call: lm(formula = I(Xi5 - Xi3) ~ W) 29 38.30 51.13 63.97 14.070 6.416 Coefficients: 30 52.61 55.52 58.42 16.680 1.452 Estimate Std. Error t value Pr(>|t|) 31 38.36 48.49 58.62 15.070 5.064 (Intercept) 10.086567 3.586436 2.812 0.00774 ** 32 45.14 51.44 57.73 13.940 3.148 W -0.002139 0.235245 -0.009 0.99279 33 53.82 64.27 74.73 20.400 5.228 --- 34 49.46 61.42 73.39 16.000 5.984 Residual standard error: 4.117 on 38 degrees of freedom 35 56.29 59.04 61.80 17.470 1.378 Multiple R-squared: 2.176e-06, Adjusted R-squared: -0.0 36 49.59 57.58 65.57 17.300 3.995 F-statistic: 8.267e-05 on 1 and 38 DF, p-value: 0.9928 37 41.45 59.43 77.41 15.860 8.991 38 47.42 57.42 67.43 18.950 5.002 > cor(W, theta) [1] -0.001592367 39 57.00 65.73 74.47 18.900 4.367 40 41.06 43.54 46.03 13.790 1.241 > pairs(~ Xi1 + Xi3 + Xi5 + W) > cor(mtruesig) Xi1 Xi3 Xi5 W theta Xi1 1.0000000 0.8422138 0.5359036 0.766175758 -0.280851506 Xi3 0.8422138 1.0000000 0.9065331 0.765188951 0.280906648 Xi5 0.5359036 0.9065331 1.0000000 0.598501096 0.659788513 W 0.7661758 0.7651890 0.5985011 1.000000000 -0.001592367 theta -0.2808515 0.2809066 0.6597885 -0.001592367 1.000000000 > #repeat with observed data > mobs = read.table(file="D:\\drr09\\stat209\\week9\\mythsobsdat", header = T) > cor(mobs) X1 X3 X5 W X1 1.0000000 0.7158619 0.4906650 0.7162989 X3 0.7158619 1.0000000 0.7405647 0.6522400 X5 0.4906650 0.7405647 1.0000000 0.6192915 W 0.7162989 0.6522400 0.6192915 1.0000000 > var(mtrue$Xi1)/var(X1) [1] 0.9840417 > var(mtrue$Xi3)/var(X3) [1] 0.9820553 > var(mtrue$Xi5)/var(X5)[1] 0.7161431 > summary(obsreg1) > summary(diffreg) Call: lm(formula = X5 ~ W + X1) Call: lm(formula = I(X5 - X1) ~ W) Coefficients: Coefficients: Estimate Std. Error t value Pr(>|t|) Estimate Std. Error t value Pr(>|t|) (Intercept) 25.6896 8.8210 2.912 0.00605 ** (Intercept) 12.0154 8.4597 1.420 0.164 W 2.1431 0.7181 2.985 0.00501 ** W 0.5488 0.5549 0.989 0.329 X1 0.1447 0.2759 0.524 0.60306 --- Residual standard error: 9.713 on 38 degrees of freedom Residual standard error: 8.77 on 37 degrees of freedom Multiple R-squared: 0.02509, Adjusted R-squared: -0.0 Multiple R-squared: 0.3881, Adjusted R-squared: 0.355 F-statistic: 0.978 on 1 and 38 DF, p-value: 0.3289 F-statistic: 11.73 on 2 and 37 DF, p-value: 0.0001132 > residch51obs = residuals(lm(X5 ~ X1)) > cor.test(W, residch51obs) Pearson's product-moment correlation data: W and residch51obs t = 1.9912, df = 38, p-value = 0.05369 95 percent confidence interval: -0.004574645 0.564802526 sample estimates: cor 0.3073727 ##Same result if Difference Score is Outcome rather than final status #First the true score regressions from class 3/3 handout > truereg1D = lm(I(Xi5 - Xi1) ~ W + Xi1) > summary(truereg1D) Call: lm(formula = I(Xi5 - Xi1) ~ W + Xi1) Residuals: Min 1Q Median 3Q Max -15.692 -4.348 -1.051 6.406 15.788 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 31.2139 7.5445 4.137 0.000194 *** W 1.5002 0.6680 2.246 0.030788 * Xi1 -0.7608 0.2588 -2.940 0.005624 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 7.514 on 37 degrees of freedom Multiple R-squared: 0.1894, Adjusted R-squared: 0.1456 F-statistic: 4.323 on 2 and 37 DF, p-value: 0.02055 > truereg2D = lm(I(Xi5 - Xi3) ~ W + Xi3) > summary(truereg2D) Call: lm(formula = I(Xi5 - Xi3) ~ W + Xi3) Residuals: Min 1Q Median 3Q Max -7.26371 -2.36848 -0.07474 2.20751 8.12447 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.6874 4.5537 0.151 0.88083 W -0.7570 0.3329 -2.274 0.02886 * Xi3 0.3821 0.1290 2.963 0.00529 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 3.751 on 37 degrees of freedom Multiple R-squared: 0.1918, Adjusted R-squared: 0.1481 F-statistic: 4.391 on 2 and 37 DF, p-value: 0.01945 > detach(mtruesig) > attach(mobs) ## Also Observed score regressions, use difference score as outcome > obsreg1D = lm(I(X5 - X1) ~ W + X1) > summary(obsreg1D) Call: lm(formula = I(X5 - X1) ~ W + X1) Residuals: Min 1Q Median 3Q Max -18.363 -4.825 -1.394 7.661 21.665 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 25.6896 8.8210 2.912 0.00605 ** W 2.1431 0.7181 2.985 0.00501 ** X1 -0.8553 0.2759 -3.100 0.00369 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 8.77 on 37 degrees of freedom Multiple R-squared: 0.2261, Adjusted R-squared: 0.1842 F-statistic: 5.404 on 2 and 37 DF, p-value: 0.00873