I am trying to understand a bit about linear contrasts and arriving at T values.
If I use voxel data from a pet study I can (thankfully) arrive at the same T
value as SPM does using the GLM method of calculating it however I can't
seem to get the same result using a more 'classical' method although it is
close (by classical I mean how anovas & t-tests are often described -
probably not the right word). What am I neglecting? (Excuse the maths but
I'm not sure how else to explain it...)
For example:
7 subjects, 4 conditions, repeated measures design (df=18).
If I have a design matrix X, voxel values Y (as a vector) and a linear
contrast vector C (I've given examples below) then
T = C*B / sqrt(R.V)
where
B = pinv(X*X')*X'*Y
V = C*pinv(X)*pinv(X')*C'
R = (E'*E)/18
E = Y-BX
Although I can't picture whats going on I get the same T value as SPM.
In the 'classical' method I create a new variable for each subject
(s1,s2,...) as the linear contrast of the conditions (c1,c2,...) e.g. for
the contrast [-2 -1 1 2]
d(1) = -2*s1c1 - 1*s1c2 + 1*s1c3 + 2s1c4
d(2) = -2*s2c1 - 1*s2c2 + 1*s2c3 + 2s2c4
.....etc ....
and
T = mean(d) / SE(d)
where
SE(d) = sqrt(sum((d-mean(d)).^2) / 6) / 7)
In the example data below T = 8.38126215 but the 'classical' method gives
8.293911774.
Although its not as all encompassing as the GLM (or as right) its easier to
see what you're doing.
Can someone explain?
Thanks,
Joel
C=[-2 -1 1 2 0 0 0 0 0 0 0];
Y=[40.69039510089635
41.39620528166707
43.43104525892857
44.99124674357315
40.31683391933539
38.71653529539368
44.68110679229493
46.90621253409378
43.00840258935457
43.98384958241456
43.81080528382573
47.98607815300878
39.70960207542875
43.26305003181865
44.28584679994975
45.21049043493899
42.88437945782151
44.58178958064413
46.83784473590170
47.86523299326414
47.97580144226312
51.35596376613802
55.76978627941236
55.72821462610009
48.65448605906967
49.83235146830024
53.40125480356219
51.95920558239399];
X=[ 1 0 0 0 1 0 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 0 1 0 0 1 0 0 0 0 0
0 0 0 1 0 1 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0
0 1 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
0 1 0 0 0 0 0 1 0 0 0
0 0 1 0 0 0 0 1 0 0 0
0 0 0 1 0 0 0 1 0 0 0
1 0 0 0 0 0 0 0 1 0 0
0 1 0 0 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 0 1 0 0
1 0 0 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 1
0 0 0 1 0 0 0 0 0 0 1];
|