> I was interested in the other suggestion you made about creating
> something analagous to a difference image at the first level. Could I
> do this by using IMCALC (say something simple like "i1-12") with the
> jacobian modified first and second scans and then, at a second level,
> doing an ANCOVA using time interval between scans as a covariate?
You could do that, but with pairs of scans you don't need to do a two
level analysis if you model subject effects with a paired t-test
type of design matrix. This is because all the residual variance
from the model is between subject. This makes it possible to make
inferences about the general population. If there were more than two
scans pere subject, then the source of some of the residual variance
would be within subject, so the results would not be as generalisable.
The following should show that both methods give the same results. It
should also show how simple a t test using the General Linear Model
really is when there is no autocorrelation:
%___________________________________________________________________
y0 = rand(20,1); % data
t1 = exp(rand(10,1)); % time difference
%___________________________________________________________________
% Paired t-test type analysis
t0 = reshape([t1 zeros(10,1)]',20,1);
X0 = [t0 kron(eye(10),[1 1]')]; % design matrix
df0 = size(X0,1) - rank(X0); % degrees of freedom
c0 = [1 0 0 0 0 0 0 0 0 0 0]; % contrast
b0 = X0\y0; % parameter estimates
ms0 = sum((y0-X0*b0).^2)/df0; % mean squared error
t0 = c0*b0 / sqrt(ms0*(c0*pinv(X0'*X0)*c0')) % t statistic
%___________________________________________________________________
% Mixed effects analysis
y1 = -diff(reshape(y0,2,10))'; % beta values from first analysis
X1 = [t1]; % design matrix
df1 = size(X1,1) - rank(X1); % degrees of freedom
c1 = [1]; % contrast
b1 = X1\y1; % parameter estimates
ms1 = sum((y1-X1*b1).^2)/df1; % mean squared error
t1 = c1*b1 / sqrt(ms1*(c1*pinv(X1'*X1)*c1')) % t statistic
%___________________________________________________________________
Best regards,
-John
--
Dr John Ashburner.
Functional Imaging Lab., 12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420 http://www.fil.ion.ucl.ac.uk/~john
|