Hi Mark,

One more question is how -D option demean the data. I discuss with statistics people, we thought if data minus mean of group, the p value should not change. However, if it is every voxel minusing the mean value of the whole brain, p value will change.

Mingxia


On Tue, Jan 8, 2013 at 2:18 AM, Mark Jenkinson <[log in to unmask]> wrote:
Dear Mingxia,

The confusing thing about demeaning is that *sometimes* it doesn't matter if you demean or not (for very specific questions) but demeaning is almost always the safe option and will give you the sensible answer, whereas not demeaning is sometimes OK and sometimes not.  So I would strongly advise demeaning in general.  What you are talking about in the first paragraph is true in certain situations, but it is much safer to demean always.

You are also right that for randomise you would get different results if demeaning or not.  This is a case where they are different, but isn't specific to randomise - it would be the same for FEAT or anything based on the GLM.  The situation here is that if you do not include a constant EV (to model the mean) then it makes a big difference whether you demean or not, and the "right" answer is to demean (in order to get the slope or "correlation" strength).  If you did include a constant EV instead then you would get the same answer whether you demeaned the behavioural data or not, but there is no reason to complicate things and so again I advocate demeaning the data in general, to be safe.  You can also get the same result by not having the constant EV *and* using -D to demean the data (and model if it isn't already demeaned).  

So the summary is to always demean the values and if you are not including a constant EV in randomise then you use the -D option to remove the mean from the data.  Note that in FEAT it already removes the mean in the first-level analyses, but does not in the higher-level analyses.  So in higher-level FEAT you would need to include a constant EV to model the mean.

In the last paragraph I seem to have confused you with what I wrote before.  The statement that you quoted here referred to the case where the -D option was used (in randomise).  If you do not use the -D option then randomise does not alter the model at all.  If you do use the -D option then randomise will remove the mean from the data, and if it detects that there is a non-zero mean in the model, then it will remove this from the model as well.  That is all I meant to say.

I hope that this is all a bit clearer now.
All the best,
Mark


On 4 Jan 2013, at 22:12, zhang mingxia <[log in to unmask]> wrote:

Hi Matthew,

Thanks so much! 

But this seems different from my understanding of the model in FEAT. I remembered that the model in FEAT would not demean the brain data and the "coefficient" won't change regardless the model is demeaned or not ("intercept" will change). So, if you want a mean brain signal, you need to demean the behavior data. If you don't want a mean signal, you don't need to demean the data because the coefficient is the same in both situation.

For the code of randomise, when the non-zero mean behavior data in the model (and no use the -D option), it means both the model and data are not demeaned? And when we used the demeaned behavior data in the model and -D option, it means both model and data are demeaned? I saw these two situation got different results. Could you please tell me when I should use the former one and when the later one?


By the way, I can not understand "  If you have not removed the mean from your model EVs then randomise will (now, as of version 5.0) _also_ remove the mean from the model EVs too (as well as removing the mean from the data).  It does this just for convenience and consistency as there is no situation where you want a non-zero mean in the EVs but also want to demean the data." (Mark said). Does that mean when you use the non-zero mean behavior data in the model, randomise will also demean the model and data? If so, what is the difference between this use and when you use the zero mean behavior data and -D option.

Mingxia


On Fri, Jan 4, 2013 at 2:40 AM, Matthew Webster <[log in to unmask]> wrote:
Hello,
          If you GLM model includes the mean signal in some form then you do not need to use the -D option, if your GLM model has been demeaned you need to use the -D option.

Kind Regards

Matthew

Hi Mark,

Thank you so much! So when I correlate the behavioral data with FA, I either use the original behavioral data in the Glm model and do not use the -D option or use the demeaned behavioral data in the Glm model and -D option, is that right?

Mingxia


On Thu, Jan 3, 2013 at 11:28 PM, Mark Jenkinson <[log in to unmask]> wrote:
Hi,

The -D option should be used when you are not interested in the mean signal in the data and want to remove it.  In this situation you should also remove the mean from your model EVs.  If you have not removed the mean from your model EVs then randomise will (now, as of version 5.0) _also_ remove the mean from the model EVs too (as well as removing the mean from the data).  It does this just for convenience and consistency as there is no situation where you want a non-zero mean in the EVs but also want to demean the data.  However, ideally you should not have a non-zero mean in the EVs in the first place for such a design, in which case the -D option only needs to demean the data.

The use of -D depends on what you are modelling.  If you are not modelling the mean in the data and want to make it zero mean (such as testing for a correlation with a demeaned behavioural score, and _only_ this) then use -D.  If you are intentionally modelling a non-zero mean somewhere in the design matrix then do not use the -D option.

If randomise detects that your design is already demeaned (i.e. all EVs have zero mean) but the data has a non-zero mean, then this is a poor model (since then the mean component would be considered as "noise") and so it gives the warning message you see, suggesting that you should remove the mean from the data with the -D option.

In summary, you either want both model and data to be demeaned, or both model and data to have non-zero means in them.  In the former case you can use the -D option to remove the mean from the data (and model if it hasn't been done already).  In the latter case you do not use the -D option.  Both can be appropriate for use with behavioural data - it just depends on what kind of data you have and what else you are modelling.

I hope this is clearer for you.
All the best,
        Mark


On 3 Jan 2013, at 21:55, zhang mingxia <[log in to unmask]> wrote:

> Dear FSL experts,
>
> I am now confused by the -D option of the randomise.
>
>   -D              demean data temporally before model fitting
>
> This option should be used when I have demeaned the behavioral data or when I use the original behavioral data? My understanding is that if I used the demeaned behavioral data, I don't need to use this option. However, there is an error to ask me to use this option when I used the demeaned data.
>
> Warning: All design columns have zero mean - consider using the -D option to demean your data