On Fri, Dec 9, 2011 at 10:20 AM, Thomas Nichols <[log in to unmask]> wrote:
Dear Lorena,

If you only have pre- or only post-treatment data, you only have one measurement per subject, and thus  you don't (can't) have per-subject indicator regressors.  I.e you'll only have 1 regressor (if you use the -D option, or 2 regressors if you also include the mean).  

As for the contrasts you have below, dropping EV2 and on will give you the appropriate contrast.

See more below...

On Fri, Dec 9, 2011 at 3:56 AM, Lorena Jimenez-Castro <[log in to unmask]> wrote:
Hello Dr. Nichols and FSL users,

So, that means the design contrasts have to be like this:

Pre_treatment:

Design Contrast:

                                                                EV1  EV2     EV3                            EV12         EV13     EV14
C1: preTx_ positive correlation > post_tx     1     0           0         .  .  .  ..            0              0             0
C2: preTx_ negative correlation > post_tx   -1    0           0         .  .  .  ..            0               0            0
C3: pre_tx positive correlation mean            1     0.08     0.08      .  .  .  ..           0.08       0.08        0.08
C4: pre_tx negative correlation mean          1    -0.08    -0.08      .  .  .  ..          -0.08     -0.08      -0.08

Contrast masking:
C1 masking with C3>2.3 = real preTx_ positive correlation > post_tx
C2 masking with C4>2.3 = real  preTx_ negative correlation > post_tx



 Post-Treatment:
Design Contrast:

                                                                EV1   EV2     EV3                      EV12      EV13   EV14
C1:post_tx positive correlation > pre_tx     -1      0           0     .  .  .  ..            0          0          0
C2: post_tx negative correlation > pre_tx    1      0           0     .  .  .  ..            0          0          0
C3:post_tx positive correlation mean          -1      0.08    0.08  .  .  .  ..           0.08     0.08     0.08
C4: post_tx negative correlation mean        -1     -0.08  -0.08  .  .  .  ..          -0.08    -0.08    -0.08


Contrast masking:
C1 masking with C3>2.3 =real  post_tx positive correlation > pre_tx
C2 masking with C4>2.3= real  post_tx negative correlation > pre_tx

Is that correct?


Beside I've actually got a couple of questions, and I would greatly appreciate any advice:

1) If I use the designs describe above, I understand that I cannot  say  that the mean pre or mean post contrasts represent regions that are significantly positive/negative, right?

Why not?  This is a box standard group model, that tells you precisely that inference for each set of data.  It just can't be used to make inference on any *difference* between pre or post.
 
2)My last question:  If I were running an "unpaired t-test" with two groups (controls and patients). I understand that would be a between-subject design. So, in that case the following design would be right:


                   Group     EV1     EV2
subject 1         1          1         0
subject 2         1          1         0
subject 3         1          0         1
subject 4         1          0         1


Contrast:                                                          EV1       EV2
C1: Group 1 positive activation > Group 2            1          -1
C2: Group 2 positive activation > Group 1           -1           1
C3: Group 1 positive activation mean                   1           0
C4: Group 2 positive activation mean                   0           1
C5: Group 1 negative activation > Group 2          -1          1
C6: Group 2 negative activation > Group 1           1          -1
C7: Group 1 negative activation mean                  -1          0
C8: Group 2 negative activation mean                   0          -1

Contrast masking:

C1 with C3>2.3 = real group 1 positive correlation > group 2
C2 with C4>2.3 =real  group 2 positive correlation > group 1
C5 with C7>2.3 = real  group 1 negative correlation > group 2
C6 with C8>2.3= real  group 2 negative correlation > group 1

Is that right?

YES.  Here, because it's cross-sectional / between-subject model, all of these contrasts are valid & kosher.

-Tom


 



Thank you again so much for your help

Lorena Jimenez-Castro, M.D





From: Thomas Nichols <[log in to unmask]>
To: [log in to unmask]
Sent: Thursday, December 8, 2011 3:17 AM
Subject: Re: [FSL] GLM

Dear Lorena,

Sorry for not more directly answering your question.  The bottom line is that contrasts C3-C6 assess between-subject effects and these cannot be estimated properly in your within-subject model.  You need to create a between-subject model that uses only a single scan per subject to estimate the between-subject effects described by C3-C6 (i.e one model for pre_tx, one model for post_tx).

Also, note your C1 & C2 are identical to C7 & C8.

-Tom

On Wed, Dec 7, 2011 at 10:52 PM, Lorena Jimenez-Castro <[log in to unmask]> wrote:
Hello professors Steve, Donald and Thomas

Thank you very much for answering my question. I really appreciate it!! I just want to make sure that my design is fine now and that I am doing the right thing. As I said in my previous email I have 13 subjects with pre and post treatment resting data. My main concert is regarding the negative contrasts,  So now my designs look like this:

Design matrix:

subject group           EV1     EV2     EV3     EV4       .  .  .       EV13     EV14
1               1                         1     1         0       0       .  .  .          0            0
2               1                         1     0         1       0       .  .  .          0            0
3               1                         1     0         0       1        .  .  .         0            0
.
.
13              1                       1       0       0        0      .  .  .            0            1
14              1                      -1       1       0        0      .  .  .            0            0
15              1                      -1       0       1        0      .  .  .            0            0
.
.
26              1                      -1       0       0       0       .  .  .             0           1


Design Contrast:

                                                                EV1 EV2     EV3                            EV12         EV13  EV14
c1: preTx_ positive correlation > post_tx     1   0           0    .  .  .  ..            0          0              0
C2:post_tx positive correlation > pre_tx         -1       0           0    .  .  .  ..            0          0              0
C3:pre_tx positive correlation mean               1       0.08   0.08      .  .  .  ..           0.08     0.08        0.08
C4:post_tx positive correlation mean             -1       0.08   0.08              .  .  .  ..           0.08     0.08        0.08
C5: pre_tx negative correlation mean      1      -0.08  -0.08      .  .  .  ..          -0.08    -0.08     -0.08
C6: post_tx negative correlation mean     -1     -0.08  -0.08      .  .  .  ..           -0.08   -0.08       -0.08
C7: preTx_ negative correlation > post_tx   -1    0      0                 .  .  .  ..              0           0            0
C8: post_tx negative correlation > pre_tx          1      0      0                 .  .  .  ..               0          0            0



Contrast masking:

C1 with C3>2.3 = real preTx_ positive correlation > post_tx
C2 with C4>2.3 =real  post_tx positive correlation > pre_tx
C7 with C5>2.3 = real  preTx_ negative correlation > post_tx
C8 with C6>2.3= real  post_tx negative correlation > pre_tx


Thank you for your kind attention to this matter.

Lorena














Subject:                Re: GLM
From:           Thomas Nichols <[log in to unmask]>
Reply-To:               FSL - FMRIB's Software Library <[log in to unmask]>
Date:           Wed, 7 Dec 2011 16:23:57 +0000
Hi FSLers,

I was involved in some off-list chatter about confusion between fixed-effects vs. mixed-effects inference and within-subjects design vs. a between-subjects design.  While it's clear to me (& Donald), I get the impression that non-stats folks might get confused.

Executive summary: The traditional paired t-test model, testing for the mean difference (an intrasubject-effect) gives valid mixed effects inference.  The within- and between- distinction for effects is useful for extending our vocabulary of effects and models, and even suggests a way you may want to divide up variables that have both within- and between-subject variation.


First, as the term "design" may seem to apply to the entire structure of the experiment, I'm going to avoid it instead to refer to different possible "models", and the different possible "effects" you can test in those models.  Now, what are these different effects?

A Between-subjects effect:  An effect defined by a covariate that is constant for each subject.  Examples include age (at start of study), gender, or education.

A Within-subjects effect:  An effect defined by a covariate that has different values for each subject.  Examples include "pre" "post" status, visit number (in a longitudinal study).

I call variable that has the *same* set of values for each subject (like visit) is a "pure within-subject effect," or "balanced within-subject effect".  A variable that varies within subjects but that has different possibile values for each subject, like performance or hormone level, has both within- and between-subject variation.  Some people in the statistics argue that such covariates should be split up, into a pure within-subject effect and a between subject effect, to better understand what's going on.  See Neuhaus & Kalbfleisch (1998) for more on this.


All of the trouble here is because we're trying to stretch the poor old General Linear Model (GLM) to the breaking point with repeated measures data: The GLM, fit with Ordinary Least Squares (OLS), is intended for *independent* data, no repeated measures, one observation per subject... a model that *excludes" the possibility of any within-subject effects.

Note, while FEAT's FLAME *does* account for the varying 1st level variance, giving precise estimates of group BOLD effects, it *does not* account for any repeated measures correlation in the 2nd level model.  Feeding FLAME two or more COPE's per subject in a group model relies on the same tricks as we use with vanilla OLS+GLM (i.e. using subject indicator variables).

Given this, hopefully Donald's advice can hopefully be received received more clearly:

(1) Within-subject designs (paired t-test/one-way repeated measure ANOVAs) should only be used to evaluate within-subject effects, not between-subject effects.

Within-subject model = more than one image per subject; with GLM+OLS, 2 measures per subject fit with a pair t-test model (intercept, difference, subject indicator variables) you a mixed effects inference on the mean difference, but nothing else.  With 3 or more measures per subject, a balanced intrasubject factor, and GLM+OLS can deliver mixed effects *on* intrasubject contrasts *if* an assumption of compound symmetry holds.

(2) Between-subject designs (one-sample t-test, two-sample t-test, one-way ANOVAs) can evaluate between subject effects.

Have a between-subjects effect but more than one image per subject?  Sorry, GLM+OLS can't help.  You have to boil your data down to a single image.

(3) Mixed designs (within-subject and between-subject factors) should only be used to evaluate within-subject effects, not between-subject effects.

Within the constraints of GLM+OLS, I don't think this case arises.  A between-subject effect (e.g. Age) is totally subsumed by the subject indicators, so you simply can't fit a between-subject effect in this case.  A within-subject effect that isn't 'pure' can be fit, but it then falls out of the special case where we know GLM+OLS gives the same answers as PROC_MIXED/lmer... need to check it on a case-by-case basis.

Hope this helps!

-Tom

Neuhaus, J. M., & Kalbfleisch, J. D. (1998). Between- and Within-Cluster Covariate Effects in the Analysis of Clustered Data. Biometrics, 54(2), 638-645. doi:10.2307/3109770


On Tue, Dec 6, 2011 at 4:34 PM, MCLAREN, Donald <[log in to unmask]> wrote:
No.

Purely within-subject designs are random effect designs. The error term of the condition factor is MScondition/MSsubject*condition and the error term of the subject factor is MSsubject/MSsubject*condition.

However, using the simple fixed effects ways of computing error terms does not allow the computation of the between-subject error. Putting it another way, the issue is computing the use of the correct error term. In a between-subject design, you have the between-subject error. In a within-subjects design, you have two error terms -- the within-subject error which is the the residual of the model and the between-subject error that is computed separately.

In summary:
(1) Within-subject designs (paired t-test/one-way repeated measure ANOVAs) should only be used to evaluate within-subject effects, not between-subject effects.
(2) Between-subject designs (one-sample t-test, two-sample t-test, one-way ANOVAs) can evaluate between subject effects.
(3) Mixed designs (within-subject and between-subject factors) should only be used to evaluate within-subject effects, not between-subject effects.

Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.



On Tue, Dec 6, 2011 at 8:07 AM, Stephen Smith <[log in to unmask]> wrote:
Indeed - thanks - you mean this is a fixed-effects and not a mixed-effects analysis.
Cheers.


On 6 Dec 2011, at 13:00, MCLAREN, Donald wrote:

Steve,

You are right on the contrast. However, one needs to make sure they do not interpret the statistics from the contrast. That is to say, you should not interpret the mean pre contrast as regions that are significantly positive/negative from this model. It is fine to use the contrast as a mask for positive versus negative areas with a p-value of .5.

The reason you can not interpet the regions as significantly positive/negative is that the statistics for between-subject effects (e.g. mean pre or mean post in this model) is that the error term for the paired t-test is the within-subject error.

Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.



On Tue, Dec 6, 2011 at 4:25 AM, Stephen Smith <[log in to unmask]> wrote:
Hi - - if you expand on how this modelling is working you'll see (e.g. for two subjects):

S1pre = PE1 + PE2
S2pre = PE1 + PE3
S1post = -PE1 + PE2
S2post = -PE1 + PE3

so if you want MEANpre = (S1pre+S2pre)/2

that would be (2*PE1 + PE2 + PE3) / 2 =  PE1 + PE2/2 + PE3/2

ie a contrast of [1 0.5 0.5]

I *think* this is right?

Cheers.





On 5 Dec 2011, at 18:53, Lorena Jimenez-Castro wrote:

Dear FSL experts,

I have sent you an email last week and I have not received a reply yet, So I would appreciate any advice you could give me regarding my previous post (Please see the email below)

Thank you very much

Lorena








Subject: GLM

From: Lorena Jimenez-Castro <[log in to unmask]>

Reply-To: FSL - FMRIB's Software Library <[log in to unmask]>

Date: Mon, 28 Nov 2011 22:37:43 +0000

Reply

Dear FSL experts,

I would like to verify if I am on  the right track setting up a design for a resting state seed based analysis on a group of 13 subjects with pre and post treatment data. I am trying to set up the design matrix and design contrast to run the higher-level analysis using FEAT. I know I have to use “one group paired t test†but also I want to use “contrast masking†to mask the positive and negative co-activation, that is why I also need to get from the pre and post groups the correspond negative co-activation mean and positive co-activation mean.

I would like to know if the following designs are correct:

Design matrix:

subject group           EV1     EV2     EV3     EV4       .  .  .       EV13     EV14
1               1                         1     1         0       0                        0            0
2               1                         1     0         1       0                        0            0
3               1                         1     0         0       1                        0            0
.
.
13              1                       1       0       0        0                         0            1
14              1                      -1       1       0        0                         0            0
15              1                      -1       0       1        0                         0            0
.
.
26              1                      -1       0       0       0                           0           1


Design Contrast:

                                                                EV1 EV2 EV3                            EV12   EV13    EV14
c1: preTx_ positive correlation > post_tx     1   0      0         .  .  .  ..            0               0             0
C2:post_tx positive correlation > pre_tx         -1       0      0                                0               0             0
C3:pre_tx positive correlation mean               1       1      1                                 1              1              1
C4:post_tx positive correlation mean             -1       1      1                                 1              1              1
C5: pre_tx negative correlation mean      1       -1     -1                               -1             -1             -1
C6: post_tx negative correlation mean     -1      -1     -1                               -1             -1             -1
C7: preTx_ negative correlation > post_tx   -1    0      0                                 0              0               0
C8: post_tx negative correlation > pre_tx          1      0      0                                 0              0               0



Contrast masking:

C1 with C3>0 = real preTx_ positive correlation > post_tx
C2 with C4>0 =real  post_tx positive correlation > pre_tx
C7 with C5>0 = real  preTx_ negative correlation > post_tx
C8 with C6>0= real  post_tx negative correlation > pre_tx

Am I doing the right thing?

Any hint on this would be greatly appreciated

Thanks

Lorena



---------------------------------------------------------------------------
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director,  Oxford University FMRIB Centre




--
__________________________________________________________
Thomas Nichols, PhD
Principal Research Fellow, Head of Neuroimaging Statistics
Department of Statistics & Warwick Manufacturing Group
University of Warwick, Coventry  CV4 7AL, United Kingdom

Web: http://go.warwick.ac.uk/tenichols
Email: [log in to unmask]
Phone, Stats: +44 24761 51086, WMG: +44 24761 50752
Fax:  +44 24 7652 4532





--
__________________________________________________________
Thomas Nichols, PhD
Principal Research Fellow, Head of Neuroimaging Statistics
Department of Statistics & Warwick Manufacturing Group
University of Warwick, Coventry  CV4 7AL, United Kingdom

Web: http://go.warwick.ac.uk/tenichols
Email: [log in to unmask]
Phone, Stats: +44 24761 51086, WMG: +44 24761 50752
Fax:  +44 24 7652 4532