/* Analysis of Vocabulary Data - Bock p. 454 "Data are drawn from test results on file in the Records Office of the Laboratory School of the University of Chicago. They consist of scores, obtained from a cohort of pupils at the eigth through eleventh gade level on alternative forms of the vocabulary section of the Cooperative Reading Tests." There are 64 students in all, 36 male, 28 female (ordered). */ OPTIONS NOCENTER FORMCHAR = "|----|+|---+="; TITLE1 'Trend in Vocabulary across Grades'; PROC IML; Y = { 1.75 2.60 3.76 3.68, 0.90 2.47 2.44 3.43, 0.80 0.93 0.40 2.27, 2.42 4.15 4.56 4.21, -1.31 -1.31 -0.66 -2.22, -1.56 1.67 0.18 2.33, 1.09 1.50 0.52 2.33, -1.92 1.03 0.50 3.04, -1.61 0.29 0.73 3.24, 2.47 3.64 2.87 5.38, -0.95 0.41 0.21 1.82, 1.66 2.74 2.40 2.17, 2.07 4.92 4.46 4.71, 3.30 6.10 7.19 7.46, 2.75 2.53 4.28 5.93, 2.25 3.38 5.79 4.40, 2.08 1.74 4.12 3.62, 0.14 0.01 1.48 2.78, 0.13 3.19 0.60 3.14, 2.19 2.65 3.27 2.73, -0.64 -1.31 -0.37 4.09, 2.02 3.45 5.32 6.01, 2.05 1.80 3.91 2.49, 1.48 0.47 3.63 3.88, 1.97 2.54 3.26 5.62, 1.35 4.63 3.54 5.24, -0.56 -0.36 1.14 1.34, 0.26 0.08 1.17 2.15, 1.22 1.41 4.66 2.62, -1.43 0.80 -0.03 1.04, -1.17 1.66 2.11 1.42, 1.68 1.71 4.07 3.30, -0.47 0.93 1.30 0.76, 2.18 6.42 4.64 4.82, 4.21 7.08 6.00 5.65, 8.26 9.55 10.24 10.58, 1.24 4.90 2.42 2.54, 5.94 6.56 9.36 7.72, 0.87 3.36 2.58 1.73, -0.09 2.29 3.08 3.35, 3.24 4.78 3.52 4.84, 1.03 2.10 3.88 2.81, 3.58 4.67 3.83 5.19, 1.41 1.75 3.70 3.77, -0.65 -0.11 2.40 3.53, 1.52 3.04 2.74 2.63, 0.57 2.71 1.90 2.41, 2.18 2.96 4.78 3.34, 1.10 2.65 1.72 2.96, 0.15 2.69 2.69 3.50, -1.27 1.26 0.71 2.68, 2.81 5.19 6.33 5.93, 2.62 3.54 4.86 5.80, 0.11 2.25 1.56 3.92, 0.61 1.14 1.35 0.53, -2.19 -0.42 1.54 1.16, 1.55 2.42 1.11 2.18, -0.04 0.50 2.60 2.61, 3.10 2.00 3.92 3.91, -0.29 2.62 1.60 1.86, 2.28 3.39 4.91 3.89, 2.57 5.78 5.12 4.98, -2.19 0.71 1.56 2.31, -0.04 2.44 1.79 2.64}; poly = { 1 1 1 1, 0 1 2 3, 0 1 4 9, 0 1 8 27}; N = NROW(Y) ; P = NCOL(Y) ; ymean = J(P,1,0); DO i = 1 TO P; ymean[i,1] = SUM(Y[,i]) / N; END; polyo = INV(T(ROOT(poly*T(poly))))*poly; ymeant = T(ymean); PRINT 'Timepoint Means', ymeant [FORMAT=10.4]; PRINT 'Orthonormalized Polynomial contrasts', polyo [FORMAT=12.6]; orthest = polyo * ymean; PRINT 'Orthogonal Trend estimates', orthest [FORMAT=10.4]; SST = N*polyo*ymean*T(ymean)*T(polyo); PRINT 'SST', SST [FORMAT=12.6]; SSR = polyo*(T(Y)*Y-N*ymean*T(ymean))*T(polyo); PRINT 'SSR', SSR [FORMAT=12.6]; SSTIME = TRACE(SST[2:P,2:P]); SSSUBJ = SSR[1,1]; SSERR = TRACE(SSR[2:P,2:P]); PRINT 'SS Time', SSTIME [FORMAT=10.4]; PRINT 'SS Subjects', SSSUBJ [FORMAT=10.4]; PRINT 'SS Error', SSERR [FORMAT=10.4]; /* CALCULATION OF ROY'S GREATEST ROOT STATISTIC */; E = INV(T(ROOT(SSR[2:P,2:P]))); EI = E*SST[2:P,2:P]*T(E); EIVAL = EIGVAL(EI); ROYS = EIVAL[1,1]; PRINT "Roys's Greatest Root", ROYS [FORMAT=10.4]; /* CALCULATION OF WILK'S LAMBDA STATISTIC */; EDET = DET(SSR[2:P,2:P]); TDET = DET(SST[2:P,2:P] + SSR[2:P,2:P]); WILKS = EDET / TDET; PRINT "Wilk's Lambda", WILKS [FORMAT=10.4]; Trend in Vocabulary across Grades Timepoint Means YMEANT 1.1372 2.5417 2.9883 3.4716 Orthonormalized Polynomial contrasts POLYO 0.500000 0.500000 0.500000 0.500000 -0.670820 -0.223607 0.223607 0.670820 0.500000 -0.500000 -0.500000 0.500000 -0.223607 0.670820 -0.670820 0.223607 Orthogonal Trend estimates ORTHEST 5.0694 1.6658 -0.4606 0.2224 SST SST 1644.708025 540.452401 -149.445175 72.161584 540.452401 177.593100 -49.107807 23.712355 -149.445175 -49.107807 13.579225 -6.556909 72.161584 23.712355 -6.556909 3.166090 SSR SSR 873.603225 3.835681 -49.823325 -23.757286 3.835681 50.424610 12.046277 -3.364035 -49.823325 12.046277 43.950525 -4.271675 -23.757286 -3.364035 -4.271675 60.566600 SS Time SSTIME 194.3384 SS Subjects SSSUBJ 873.6032 SS Error SSERR 154.9417 Roys's Greatest Root ROYS 4.7432 Wilk's Lambda WILKS 0.1741