Hi - for the GLM equations for contrasts I recommend you read (for
example) Keith Worsley's chapter in our FMRI book.
In matlab-speak, the equation is
varcope(i)=c'*pinvX*pinvX'*c*sigsq;
Cheers.
On 14 Jul 2009, at 03:22, Michael Scheel wrote:
> Hi Jesper, thanks for your answer. A short follow up question. I'm
> still a bit unsure about the Variance of a contrast. I know that
> Variance is the Sum of the Squared Deviations from the Mean. However
> I just don't get if for contrasts and I guess my question really is:
> How is the VARCOPE calculated?
>
> Here is what I think it is with a simple example:
> Let's say I have a voxel with the following 25 values over time.
> 1 1 8 9 2 1 1 2 9 8 1 2 1 2 8 8 1 1 2 2 9 9 1 2 1
>
> my EV1 is
> 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0
>
> my EV2 is
> 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0
>
> taken together
> 1 1 8 9 2 1 1 2 9 8 1 2 1 2 8 8 1 1 2 2 9 9 1 2 1
> 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0
> 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0
>
> one can clearly see that EV1 covariates with the data while EV2
> doesn't.
>
> I set ev1 and ev2 up as a model matrix and got the inverse (Moore-
> Penrose-Pseudoinverse) of it and then multiplied the inverse with
> the data.
> My parameter estimate for EV1 is 8.50 and for EV2 is 1.33.
>
> I specified a contrast - Contrast1 EV1>EV2: 1 -1
> COPE in this case is the same as PE1 minus PE2. Right?
> So COPE1 would be (8.5*1) + (-1*1.33) = 7.2
>
> Now I multiply my PEs with my contrast and get [8.50, -1.33]
> then I multiply [8.50, -1.33] with my model matrix and see what the
> model predicts. In my case that would be:
> 0.00 0.00 8.50 8.50 0.00 -1.33 -1.33 0.00 8.50 8.50 0.00 -1.33
> -1.33 0.00 8.50 8.50 0.00 -1.33 -1.33 0.00 8.50 8.50 0.00 0.00 0.00
>
> When I calculate the difference between predicted_data and actual
> data I get
> 1.00 1.00 -0.50 0.50 2.00 2.33 2.33 2.00 0.50 -0.50 1.00 3.33 2.33
> 2.00 -0.50 -0.50 1.00 2.33 3.33 2.00 0.50 0.50 1.00 2.00 1.00
>
> then I square every element and sum it up - in my case 72. I think
> that is VARCOPE1 - is that right?
>
> Now I could calculate e.g. a t-test:
> t = Parameter_Estimate / Standard_Error
> t = PE / ((VARCOPE)^0.5 / (degrees_of_freedom)^0.5)
> t = 7.2 / (72^0.5 / 23^0.5) = 4.07
> That seems a rather low t-value for this made up data so I think I'm
> doing something wrong here.
>
> Sorry for these basic questions but I at least want to get the
> basics right. Thanks, Michael
>
>
> On 19-Jun-09, at 12:14 PM, Jesper Andersson wrote:
>
>> Very simple answer,
>>
>>> Hi, I have a very simple question.
>>> I know that PE means parameter estimate.
>>> What does COPE and VARCOPE stand for?
>>
>> COPE=COntrast of Parameter Estimates.
>> VARCOPE=VARiance of COntrast of Parameter Estimates.
>>
>> Jesper
>
---------------------------------------------------------------------------
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director, Oxford University FMRIB Centre
FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
+44 (0) 1865 222726 (fax 222717)
[log in to unmask] http://www.fmrib.ox.ac.uk/~steve
---------------------------------------------------------------------------
|