Re: [Freesurfer] lme and single random effect estimates

2023-09-12 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hello,

as far as I can see, the subject-specific estimates are not part of the
output for the mass-univariate (lme_FSfit) algorithm (in contrast to
the simple univariate (lme_fit_FS) algorithm, where they can be found
in stats.bihat). Not sure why that is, though.

Best regards,

Kersten

On Wed, 2023-08-30 at 22:14 +0200, Antonio Napolitano wrote:
> CAUTION: This email originated from outside of DZNE. Do not click
> links or open attachments unless you recognize the sender and know
> the content is safe.
> ACHTUNG: Dies ist eine externe E-Mail, bitte seien Sie vorsichtig
> beim Anklicken von Links oder Öffnen von Anhängen
> 
> External Email - Use Caution
> Dear Freesurfer experts, 
> I am running a mixed effect model in a long analysis (lme_FSfit) with
> 2 random effects (intercepts and slope) and I would like to have the
> estimates for each subject; would you be able to help me out with
> this. As long as I can see, there is no such info in the output
> structure. Can you please help me out with that?
> Thanks
> BW
> A 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1tH5viinqQ1nHmHj4xZH8oM2OCqaZ4zvieWaaDADI9_JV_aUxhl9F0ZuO750Uxfk8IJBP5kkEHB_u-z5A9CZ2IGQ03UL7tmbG66XvVRxMCAAH0exexXzZVnEV1iyfLaO3f6Qrk0w5Y4RfhBFpn--AjrJhRqQJMhUX2eZAfHGbCKLYMm6YO7n52aFHVNf4aWFcVxsRj_sO9GWJg455K_UPfOcIusaZobZ-2b3EG4NtDzvUBu3Qu3zImIqFnnIUAf-a73taSPgmVggx3BE21tqhImmj6-GzghK2WfPrnfKOzMqjbmAVUdU4_UqYzdPdlM-C/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer
> Please note that this e-mail is not secure (encrypted).  If you do
> not wish to continue communication over unencrypted e-mail, please
> notify the sender of this message immediately.  Continuing to send or
> respond to e-mail after receiving this message means you understand
> and accept this risk and wish to continue to communicate over
> unencrypted e-mail. 


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


[Freesurfer] lme and single random effect estimates

2023-08-30 Thread Antonio Napolitano
External Email - Use Caution
Dear Freesurfer experts, 

I am running a mixed effect model in a long analysis (lme_FSfit) with 2 random effects (intercepts and slope) and I would like to have the estimates for each subject; would you be able to help me out with this. As long as I can see, there is no such info in the output structure. Can you please help me out with that?

Thanks

BW

A 

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


Re: [Freesurfer] LME design matrix for changes in 1 group

2023-02-02 Thread Reuter, Martin,Ph.D.
Hi Amirhossein,

For GLM there is a way to compute pair-wise difference when stacking (probably 
a flag to mri_stack or preproc ) . You will end up having 1 frame per 
participant.

For LME I take this off the list as it gets very detailed about your specific 
setup and is not really a FreeSurfer issue, but rather your statistical testing 
and the hypothesis that you are interested in.

Best, Martin



On 1. Feb 2023, at 11:08, amirhossein manzouri  wrote:


Hi Martin,
I ran longitudinal pipeline on all time points so I have one template. For the 
GLM approach I first calculated pc1 for baselineVs placebo (either day1 or 
day2) and got the lh(rh).bl-pl.thickness-pc1.fwhm10.mgh then calculated pc1 for 
bl vs drug and got lh(rh).bl-drug.thickness-pc1.fwhm10.mgh. How should I look 
at the difference of difference now? should I stack them together and then 
create fsgd?
Regarding the LME approach I made the design file and followed the steps in 
tutorial , so I calculated with 2 and 1 random effect and length(dvtx) is 
smaller than 80% of length(lhcortex), so I assume that I should go for 1 random 
effect (lhstats_1RF) and CM.C = [0 0 0 1] then:

F_lhstats = lme_mass_F(lhstats_1RF,CM);
dvtx = lme_mass_FDR2(F_lhstats.pval,F_lhstats.sgn,lhcortex,0.05,0);

And now the dvtx is empty. Am I doing the right steps? Is there anything else 
you suggest?

Best regards,
Amirhossein Manzouri





On Mon, Jan 30, 2023 at 7:59 PM amirhossein manzouri 
mailto:a.h.manzo...@gmail.com>> wrote:
Thanks Martin. I assume in GLM approach I should calculate change for  session 
1 and 2 and then 3 and 4 and then run difference of difference.
We actually randomized the order so half day1 is plcebo and half drug. So I 
just need to be caretabout the design for LME.
BR

On Mon, 30 Jan 2023 at 17:09, Reuter, Martin,Ph.D. 
mailto:mreu...@mgh.harvard.edu>> wrote:
Hi Amirhossein,

So you have session 1 , placebo , session 2
Another day session 3,  drug, session 4 ?

Again if this is for all subjects, easiest is to subtract session 2 from 1, and 
4 from 3, to get thickness/volume differences for each condition. Then compute 
the difference of the differences and run a GLM testing for difference from 
zero.

An LME approach could be:
Column of 1
Column of time (zero for session 1 and 3, one for session 2 and 4)
Column of day  (zero for session 1 and 2, one for session 3 and 4)
Column of drug (zero for session 1,2,3 and one for session 4)

The last one is the interesting one. But I would discuss this with a 
bio-statistician. I develop methods for image analysis and this could be wrong 
(or sub-optimal).

Best, Martin



On 30. Jan 2023, at 16:40, amirhossein manzouri 
mailto:a.h.manzo...@gmail.com>> wrote:


Thanks a lot Martin for the information.
We have actually 2 sessions of placebo for each subject. How do you suggest to 
do the analysis including that data?
BR

On Mon, 30 Jan 2023 at 16:30, Reuter, Martin,Ph.D. 
mailto:mreu...@mgh.harvard.edu>> wrote:
Hi Amirhossein,

- If you have two time points for all participants,
- and the time difference is the same for all
you can simply subtract the thickness (or volume) values per participant and 
run a regular GLM. LME is a little overkill here.


In LME, you have one column of ones, and one of the time (which is 0 and t 
alternating ) , this is not the time difference!  The first time point is at 
time 0 and the second at time t (in hours or days whatever). If the time really 
does not matter, you can also put 0 and 1.

You can run the model with no random effect or with one random effect. The wiki 
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels
 describes how to compare those models, also how to compute significance.

You probably have more columns (also if you do the GLM) e.g. the amount of drug 
that was given, or who got the drug and who got placebo. Otherwise you cannot 
check for a drug effect. That column would be the one you are interested in.

Without a placebo group, you will find difference across time, but you will not 
know if they are from the drug or from the fact that people are familiar with 
the scanner (less head motion) or more annoyed by the scanner (more head 
motion) or more tired, or more dehydrated, or rehydrated if you give the drug 
with water, or simply a time-of-the-day effect, or scanner heats up etc.

Some of these confounders are problematic anyway, as the drug can have a 
sedative effect (less motion?) or was given with water (re-hydration). The 
second can be controlled by giving placebo with the 

Re: [Freesurfer] LME design matrix for changes in 1 group

2023-02-01 Thread amirhossein manzouri
External Email - Use Caution

Hi Martin,
I ran longitudinal pipeline on all time points so I have one template. For
the GLM approach I first calculated pc1 for baselineVs placebo (either day1
or day2) and got the lh(rh).bl-pl.thickness-pc1.fwhm10.mgh then calculated
pc1 for bl vs drug and got lh(rh).bl-drug.thickness-pc1.fwhm10.mgh. How
should I look at the difference of difference now? should I stack them
together and then create fsgd?
Regarding the LME approach I made the design file and followed the steps in
tutorial , so I calculated with 2 and 1 random effect and length(dvtx) is
smaller than 80% of length(lhcortex), so I assume that I should go for 1
random effect (lhstats_1RF) and CM.C = [0 0 0 1] then:

F_lhstats = lme_mass_F(lhstats_1RF,CM);
dvtx = lme_mass_FDR2(F_lhstats.pval,F_lhstats.sgn,lhcortex,0.05,0);

And now the dvtx is empty. Am I doing the right steps? Is there
anything else you suggest?

Best regards,
Amirhossein Manzouri





On Mon, Jan 30, 2023 at 7:59 PM amirhossein manzouri 
wrote:

> Thanks Martin. I assume in GLM approach I should calculate change for
>  session 1 and 2 and then 3 and 4 and then run difference of difference.
> We actually randomized the order so half day1 is plcebo and half drug. So
> I just need to be caretabout the design for LME.
> BR
>
> On Mon, 30 Jan 2023 at 17:09, Reuter, Martin,Ph.D. <
> mreu...@mgh.harvard.edu> wrote:
>
>> Hi Amirhossein,
>>
>> So you have session 1 , placebo , session 2
>> Another day session 3,  drug, session 4 ?
>>
>> Again if this is for all subjects, easiest is to subtract session 2 from
>> 1, and 4 from 3, to get thickness/volume differences for each condition.
>> Then compute the difference of the differences and run a GLM testing for
>> difference from zero.
>>
>> An LME approach could be:
>> Column of 1
>> Column of time (zero for session 1 and 3, one for session 2 and 4)
>> Column of day  (zero for session 1 and 2, one for session 3 and 4)
>> Column of drug (zero for session 1,2,3 and one for session 4)
>>
>> The last one is the interesting one. But I would discuss this with a
>> bio-statistician. I develop methods for image analysis and this could be
>> wrong (or sub-optimal).
>>
>> Best, Martin
>>
>>
>>
>> On 30. Jan 2023, at 16:40, amirhossein manzouri 
>> wrote:
>>
>>
>>
>> Thanks a lot Martin for the information.
>> We have actually 2 sessions of placebo for each subject. How do you
>> suggest to do the analysis including that data?
>> BR
>>
>> On Mon, 30 Jan 2023 at 16:30, Reuter, Martin,Ph.D. <
>> mreu...@mgh.harvard.edu> wrote:
>>
>>> Hi Amirhossein,
>>>
>>> - If you have two time points for all participants,
>>> - and the time difference is the same for all
>>> you can simply subtract the thickness (or volume) values per participant
>>> and run a regular GLM. LME is a little overkill here.
>>>
>>>
>>> In LME, you have one column of ones, and one of the time (which is 0 and
>>> t alternating ) , this is not the time difference!  The first time point is
>>> at time 0 and the second at time t (in hours or days whatever). If the time
>>> really does not matter, you can also put 0 and 1.
>>>
>>> You can run the model with no random effect or with one random effect.
>>> The wiki
>>> https://secure-web.cisco.com/1Ey4MhXIG_R2LHA5sT7HL2EJPi4egIFFk0CvQ42MPwbI9wb0GQML9h127BSXU9YP00g6FQ3lOo53JKDfMyyKW-gKwDM5807-3MgE9x_IGeMj-9fZ-gmYbeSuu7gzp8XwqIcMEsWBxQVV69nGwtp_GjHIaAajNBxqP4Ke4wkCH-us3y2bZWcR3Az1JpaOq4CA0sttiTArjpszVtLFCwz2UhKTmw6vzBkC3wrRxafQK0ra2r9AezZGOKP4BsmsxVRQpZ3hD-AQEguntv7jazFE1bkJKGeWbE9dklYI0F80nDpYtsGlZyJnJpfSdUr3fdcXZ/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FLinearMixedEffectsModels
>>> 
>>> describes how to compare those models, also how to compute significance.
>>>
>>> You probably have more columns (also if you do the GLM) e.g. the amount
>>> of drug that was given, or who got the drug and who got placebo. Otherwise
>>> you cannot check for a drug effect. That column would be the one you are
>>> interested in.
>>>
>>> Without a placebo group, you will find difference across time, but you
>>> will not know if they are from the drug or from the fact that people are
>>> familiar with the scanner (less head motion) or more annoyed by the scanner
>>> (more head motion) or more tired, or more dehydrated, or rehydrated if you
>>> give the drug with water, or simply a time-of-the-day effect, or scanner
>>> heats up etc.
>>>
>>> Some of these confounders are problematic anyway, as the drug can have a
>>> sedative effect (less motion?) or was given with 

Re: [Freesurfer] LME design matrix for changes in 1 group

2023-01-30 Thread amirhossein manzouri
External Email - Use Caution

Thanks Martin. I assume in GLM approach I should calculate change for
 session 1 and 2 and then 3 and 4 and then run difference of difference.
We actually randomized the order so half day1 is plcebo and half drug. So I
just need to be caretabout the design for LME.
BR

On Mon, 30 Jan 2023 at 17:09, Reuter, Martin,Ph.D. 
wrote:

> Hi Amirhossein,
>
> So you have session 1 , placebo , session 2
> Another day session 3,  drug, session 4 ?
>
> Again if this is for all subjects, easiest is to subtract session 2 from
> 1, and 4 from 3, to get thickness/volume differences for each condition.
> Then compute the difference of the differences and run a GLM testing for
> difference from zero.
>
> An LME approach could be:
> Column of 1
> Column of time (zero for session 1 and 3, one for session 2 and 4)
> Column of day  (zero for session 1 and 2, one for session 3 and 4)
> Column of drug (zero for session 1,2,3 and one for session 4)
>
> The last one is the interesting one. But I would discuss this with a
> bio-statistician. I develop methods for image analysis and this could be
> wrong (or sub-optimal).
>
> Best, Martin
>
>
>
> On 30. Jan 2023, at 16:40, amirhossein manzouri 
> wrote:
>
>
>
> Thanks a lot Martin for the information.
> We have actually 2 sessions of placebo for each subject. How do you
> suggest to do the analysis including that data?
> BR
>
> On Mon, 30 Jan 2023 at 16:30, Reuter, Martin,Ph.D. <
> mreu...@mgh.harvard.edu> wrote:
>
>> Hi Amirhossein,
>>
>> - If you have two time points for all participants,
>> - and the time difference is the same for all
>> you can simply subtract the thickness (or volume) values per participant
>> and run a regular GLM. LME is a little overkill here.
>>
>>
>> In LME, you have one column of ones, and one of the time (which is 0 and
>> t alternating ) , this is not the time difference!  The first time point is
>> at time 0 and the second at time t (in hours or days whatever). If the time
>> really does not matter, you can also put 0 and 1.
>>
>> You can run the model with no random effect or with one random effect.
>> The wiki
>> https://secure-web.cisco.com/1WKlQ0u9JEMPReF063WyLOTyVSO-47TES55AV1uo84axCXL0kE1Z5uE8xmrCOrlheB9Om3Da_FWdm7ktpek1AmfgLGoEwfjyWPw6T3WFBwwEGQPaxXCu6fBhHaOM20lPohVTYDzNNpnqdLo0ll07K3ilVb52yVueNvhlIOGszB6w-Bt4QWdTOvBHhVxmBlWQAdxi2fHYJwbtjm_y2Hb3qX94xJiF8aK1bVRRBVOWSy9PDEKEicWY18BwHVnHa8NmUdAJM-uiURRvVNdt57zKntQJXQeqYEpC2FSDfvIONjZLCp3vnUtALZSaw4z2KOVAAU1_i0sp4B_GGtG5CkFdVyg/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FLinearMixedEffectsModels
>> 
>> describes how to compare those models, also how to compute significance.
>>
>> You probably have more columns (also if you do the GLM) e.g. the amount
>> of drug that was given, or who got the drug and who got placebo. Otherwise
>> you cannot check for a drug effect. That column would be the one you are
>> interested in.
>>
>> Without a placebo group, you will find difference across time, but you
>> will not know if they are from the drug or from the fact that people are
>> familiar with the scanner (less head motion) or more annoyed by the scanner
>> (more head motion) or more tired, or more dehydrated, or rehydrated if you
>> give the drug with water, or simply a time-of-the-day effect, or scanner
>> heats up etc.
>>
>> Some of these confounders are problematic anyway, as the drug can have a
>> sedative effect (less motion?) or was given with water (re-hydration). The
>> second can be controlled by giving placebo with the same amount of water.
>> Disentangling motion from drug effect (due to the possible correlation)
>> would only be possible if you separately measure motion or take fMRI or
>> diffusion motion estimates as a proxy for motion during T1.
>>
>>
>> Head motion reduces grey matter estimates:
>> doi.org
>> 
>>
>> 

Re: [Freesurfer] LME design matrix for changes in 1 group

2023-01-30 Thread Reuter, Martin,Ph.D.
Hi Amirhossein,

So you have session 1 , placebo , session 2
Another day session 3,  drug, session 4 ?

Again if this is for all subjects, easiest is to subtract session 2 from 1, and 
4 from 3, to get thickness/volume differences for each condition. Then compute 
the difference of the differences and run a GLM testing for difference from 
zero.

An LME approach could be:
Column of 1
Column of time (zero for session 1 and 3, one for session 2 and 4)
Column of day  (zero for session 1 and 2, one for session 3 and 4)
Column of drug (zero for session 1,2,3 and one for session 4)

The last one is the interesting one. But I would discuss this with a 
bio-statistician. I develop methods for image analysis and this could be wrong 
(or sub-optimal).

Best, Martin



On 30. Jan 2023, at 16:40, amirhossein manzouri  wrote:


Thanks a lot Martin for the information.
We have actually 2 sessions of placebo for each subject. How do you suggest to 
do the analysis including that data?
BR

On Mon, 30 Jan 2023 at 16:30, Reuter, Martin,Ph.D. 
mailto:mreu...@mgh.harvard.edu>> wrote:
Hi Amirhossein,

- If you have two time points for all participants,
- and the time difference is the same for all
you can simply subtract the thickness (or volume) values per participant and 
run a regular GLM. LME is a little overkill here.


In LME, you have one column of ones, and one of the time (which is 0 and t 
alternating ) , this is not the time difference!  The first time point is at 
time 0 and the second at time t (in hours or days whatever). If the time really 
does not matter, you can also put 0 and 1.

You can run the model with no random effect or with one random effect. The wiki 
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels
 describes how to compare those models, also how to compute significance.

You probably have more columns (also if you do the GLM) e.g. the amount of drug 
that was given, or who got the drug and who got placebo. Otherwise you cannot 
check for a drug effect. That column would be the one you are interested in.

Without a placebo group, you will find difference across time, but you will not 
know if they are from the drug or from the fact that people are familiar with 
the scanner (less head motion) or more annoyed by the scanner (more head 
motion) or more tired, or more dehydrated, or rehydrated if you give the drug 
with water, or simply a time-of-the-day effect, or scanner heats up etc.

Some of these confounders are problematic anyway, as the drug can have a 
sedative effect (less motion?) or was given with water (re-hydration). The 
second can be controlled by giving placebo with the same amount of water. 
Disentangling motion from drug effect (due to the possible correlation) would 
only be possible if you separately measure motion or take fMRI or diffusion 
motion estimates as a proxy for motion during T1.


Head motion reduces grey matter estimates:

doi.org
[X]

Dehydration effects:

Re: [Freesurfer] LME design matrix for changes in 1 group

2023-01-30 Thread amirhossein manzouri
External Email - Use Caution

Thanks a lot Martin for the information.
We have actually 2 sessions of placebo for each subject. How do you suggest
to do the analysis including that data?
BR

On Mon, 30 Jan 2023 at 16:30, Reuter, Martin,Ph.D. 
wrote:

> Hi Amirhossein,
>
> - If you have two time points for all participants,
> - and the time difference is the same for all
> you can simply subtract the thickness (or volume) values per participant
> and run a regular GLM. LME is a little overkill here.
>
>
> In LME, you have one column of ones, and one of the time (which is 0 and t
> alternating ) , this is not the time difference!  The first time point is
> at time 0 and the second at time t (in hours or days whatever). If the time
> really does not matter, you can also put 0 and 1.
>
> You can run the model with no random effect or with one random effect. The
> wiki 
> https://secure-web.cisco.com/1pVifRNw5er1Lzc_ccwFC4C2YEYU4u84Wg9uAV_jJXoNhscogr7v_JipyzF28LHmewwkoWl19W9OH9e9wwz502tCA0t1_FALxC8nFNk1kCoiT1bIZJKvSWv3kYqvbvUJI22kjCf4QZAp-imXgP3CuAMub326jyEz0Yl0OamT5C0gRvQxzroaQmyUmyjfvofQ1Ue9394B6pAprHBE63UK7HveGDF42bam9KA1FKnr0LPRYYW0zwNaYhGJiYr5XBrsHM4Ix-OOicVuCd6em6DD2WAFXONP9dy5ftZxtEQhXuH8uGiDHgTb9ioKlNvSXtnV6vT_gHB_-uy7ZG_85ZO9gzw/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FLinearMixedEffectsModels
> describes how to compare those models, also how to compute significance.
>
> You probably have more columns (also if you do the GLM) e.g. the amount of
> drug that was given, or who got the drug and who got placebo. Otherwise you
> cannot check for a drug effect. That column would be the one you are
> interested in.
>
> Without a placebo group, you will find difference across time, but you
> will not know if they are from the drug or from the fact that people are
> familiar with the scanner (less head motion) or more annoyed by the scanner
> (more head motion) or more tired, or more dehydrated, or rehydrated if you
> give the drug with water, or simply a time-of-the-day effect, or scanner
> heats up etc.
>
> Some of these confounders are problematic anyway, as the drug can have a
> sedative effect (less motion?) or was given with water (re-hydration). The
> second can be controlled by giving placebo with the same amount of water.
> Disentangling motion from drug effect (due to the possible correlation)
> would only be possible if you separately measure motion or take fMRI or
> diffusion motion estimates as a proxy for motion during T1.
>
>
> Head motion reduces grey matter estimates:
> doi.org 
> 
> 
> 
>
> Dehydration effects:
> [image: 12.cover-source.jpg]
>
> Responses of the Human Brain to Mild Dehydration and Rehydration Explored
> In Vivo by 1H-MR Imaging and Spectroscopy
> 
> ajnr.org 
> 
> 

Re: [Freesurfer] LME design matrix for changes in 1 group

2023-01-30 Thread Reuter, Martin,Ph.D.
Hi Amirhossein,

- If you have two time points for all participants,
- and the time difference is the same for all
you can simply subtract the thickness (or volume) values per participant and 
run a regular GLM. LME is a little overkill here.


In LME, you have one column of ones, and one of the time (which is 0 and t 
alternating ) , this is not the time difference!  The first time point is at 
time 0 and the second at time t (in hours or days whatever). If the time really 
does not matter, you can also put 0 and 1.

You can run the model with no random effect or with one random effect. The wiki 
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels describes 
how to compare those models, also how to compute significance.

You probably have more columns (also if you do the GLM) e.g. the amount of drug 
that was given, or who got the drug and who got placebo. Otherwise you cannot 
check for a drug effect. That column would be the one you are interested in.

Without a placebo group, you will find difference across time, but you will not 
know if they are from the drug or from the fact that people are familiar with 
the scanner (less head motion) or more annoyed by the scanner (more head 
motion) or more tired, or more dehydrated, or rehydrated if you give the drug 
with water, or simply a time-of-the-day effect, or scanner heats up etc.

Some of these confounders are problematic anyway, as the drug can have a 
sedative effect (less motion?) or was given with water (re-hydration). The 
second can be controlled by giving placebo with the same amount of water. 
Disentangling motion from drug effect (due to the possible correlation) would 
only be possible if you separately measure motion or take fMRI or diffusion 
motion estimates as a proxy for motion during T1.


Head motion reduces grey matter estimates:

doi.org
[X]

Dehydration effects:

[12.cover-source.jpg]
Responses of the Human Brain to Mild Dehydration and Rehydration Explored In 
Vivo by 1H-MR Imaging and 
Spectroscopy
ajnr.org


Best, Martin



On 30. Jan 2023, at 15:18, amirhossein manzouri  wrote:


Hi,
I have 2 sessions of data acquired in the same day for each participant before 
and after the drug intake. I wonder how to analyse this with LME tool. I create 
design matrix X in 2 columns, first all ones and second the time 
differences(which are the same) and wonder if I need to only run the model with 
one random effect like

lhTh0_1RF = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3);

And what would be the next steps to get the stats and sig.mgh

Best regards,
Amirhossein Manzouri




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is 
addressed.  If you believe this e-mail was sent to you in error and the e-mail 
contains patient information, please contact the Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
 .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


[Freesurfer] LME design matrix for changes in 1 group

2023-01-30 Thread amirhossein manzouri
External Email - Use Caution

Hi,
I have 2 sessions of data acquired in the same day for each participant
before and after the drug intake. I wonder how to analyse this with LME
tool. I create design matrix X in 2 columns, first all ones and second the
time differences(which are the same) and wonder if I need to only run the
model with one random effect like

lhTh0_1RF = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3);

And what would be the next steps to get the stats and sig.mgh

Best regards,
Amirhossein Manzouri
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is 
addressed.  If you believe this e-mail was sent to you in error and the e-mail 
contains patient information, please contact the Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
 .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 


Re: [Freesurfer] LME model

2021-02-12 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hi Victor,

this file is apparently included in the NeuroStats/lme repository on GitHub (in 
the ‚geodesic‘ folder’), so getting the toolbox from there might be worth a try.

Not sure why it is not included with Freesurfer.

Best,

Kersten

Am 10.02.2021 um 21:34 schrieb Ví­ctor Leiva 
mailto:victor.le...@biomedica.udec.cl>>:


External Email - Use Caution


Dear Freesurfer experts,I'm using the LME model for longitudinal study and I'm 
running the part of parameter estimation but MATLAB "told me" than the file 
"libgeodesic.so" is not available or does not exist. So check in FreeSurfer' 
folder and it's not there. So I don't know where to find it because I can't 
found it on the internet

Thanks for your help
Best,

--
Víctor Leiva Ormeño
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://secure-web.cisco.com/1n7sL13-qc4Pqi-qoJdip8UmKnMuHcIZaqRRsANQib2DQ3Fcinz76LJcCcYwkUCn-0ZE7Sl2wA3uzl-Rc--0xR-MSszzK5LJmameEvlE473NaXXv2zrdMr2Nj1d2Xre-1K1OcUTXjliEiYA6PuIePjOj0nhP60rQVtJhkQmrNRCUsnDAFKjrt_k8PVTTrag8mmPeSf2FZ3glx2_AQkx439fv27sG0qDfKAoiLCdO5UD1PZbMFZcPZw-jwdJTW0iAGW1QSeP8VlqeLDUVc2WfXRQ/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer

--
Kersten Diers
Image Analysis Group (AG Reuter)
German Center for Neurodegenerative Diseases (DZNE)
B.1.114 | Building 99 | Venusberg-Campus 1 | 53127 Bonn | Germany
https://secure-web.cisco.com/1JTMw7SH1WQWxO016NNaFfANjDBsI_M3t8_uKSELbl6i7iTzfpcdiI0kEoPbM8dx--F6XHBdB1Gx_dG2ay8m7kH8Dh3F_QB1sD_L1nMfYsCl5cGVWfduuMlbEg-mxCtXHJG1OBJL-J1nwftb5CvTBBtcFDP4xqxYkyeb2sojsQoqfvGN1W84Op7IX41YnFlo9zP7pD71r4u01jjFdAjO5SH72-h_ifHxFW7ehFDcj767hkmBETSNltgAe3hyc6Q1dr4KoZJtINIllQ_jaOmAwDQ/https%3A%2F%2Fwww.dzne.de%2Fen%2Fsites%2Fbonn%2Fresearch-groups%2Freuter.html
Phone: +49 / 228 / 43302 - 381

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME model

2021-02-10 Thread Ví­ctor Leiva
External Email - Use Caution

Dear Freesurfer experts,I'm using the LME model for longitudinal study
and I'm running the part of parameter estimation but MATLAB "told me"
than the file "libgeodesic.so" is not available or does not exist. So
check in FreeSurfer' folder and it's not there. So I don't know where
to find it because I can't found it on the internet


Thanks for your help
Best,


-- 
Víctor Leiva Ormeño
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] LME Univariate Analysis

2021-01-28 Thread Boa Sorte Silva, Narlon
External Email - Use Caution

Just following up on my email below to see if anyone is able to help?

Thanks!
Nárlon Cássio

Nárlon Cássio Boa Sorte Silva, PhD
CIHR/MSFHR Postdoctoral Research Fellow
Aging, Mobility, and Cognitive Neuroscience Lab
Djavad Mowafaghian Centre for Brain Health
University of British Columbia
Twitter: @BoaNarlon

On Jan 20, 2021, at 9:20 PM, Boa Sorte Silva, Narlon 
mailto:narlon.si...@ubc.ca>> wrote:

[CAUTION: Non-UBC Email]
External Email - Use Caution

Dear Freesurfer Experts,
Hope this finds you well

I am following the LME tutorial running LME Univariate analysis. I was 
wondering if someone would kindly check my steps below? I wanted to make sure 
specially that my matrix (X) and and contrast (C) were designed accordingly to 
assess group*time interaction.

Study design:
Two groups: 0 = control, 1 = intervention
Time: 0 = baseline, 1 = 6-month follow-up
Outcome of interest: Change in hippocampal volume
Co-Variate: Estimated ICV

Here are the steps I took in Matlab:

# Loading into Matlab Qdec table with 7 columns in this exact order:  fsid, 
fsid-base, time, group, Righ.Hipp, Left.Hipp, estimated_ICV:
Qdec = fReadQdec('qdec-aseg.table.dat');
Qdec = rmQdecCol(Qdec,1);
sID = Qdec(2:end,1);
Qdec = rmQdecCol(Qdec,1);
M = Qdec2num(Qdec);
Y = M(:,3:4);
M = M(:,[1:2 5]); # Here I loaded estimated ICV already into M (as the third 
column), as it will be treated as a covariate later.

# Sorting data according to time
[M,Y,ni] = sortData(M,1,Y,sID);

# Building design matrix X from M, for a simple time by group interaction. Note 
that here, I have the slope column as 1, then I add time and group columns via: 
M(:,1:2), then a column for group*time via: M(:,1).*M(:,2), and finally a 
column for estimated ICV, as the final column in the matrix via: M(:,3). I 
wonder if this is correct?
X = [ones(length(M),1) [M(:, 1:2) M(:,1).*M(:,2) M(:,3)]];

# Determining model parameters, for total hippocampal volume, Left.Hipp, and 
Right.Hipp. Here, since my sample is small (N = 15), I am using 1 random effect 
only.
hipp_vol_stats_tot = lme_fit_FS(X,[1],Y(:,1)+Y(:,2),ni);
hipp_vol_stats_left = lme_fit_FS(X,[1],Y(:,1),ni);
hipp_vol_stats_right = lme_fit_FS(X,[1],Y(:,2),ni);

# Creating contrast (C) matrix for simple group*time interaction controlling 
for estimated ICV. Does this look correct, considering that the last 0 would 
control for estimated ICV?
C = [ 0 0 0 1 0];

# Finally, F test for total, left and right hippocampal volumes
F_C_tot = lme_F(hipp_vol_stats_tot,C);
F_C_left = lme_F(hipp_vol_stats_left,C);
F_C_right = lme_F(hipp_vol_stats_right,C);

Thanks so much for your help!

Nárlon Cássio

Nárlon Cássio Boa Sorte Silva, PhD
CIHR/MSFHR Postdoctoral Research Fellow
Aging, Mobility, and Cognitive Neuroscience Lab
Djavad Mowafaghian Centre for Brain Health
University of British Columbia
Twitter: @BoaNarlon

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://secure-web.cisco.com/1qEruuMyPPYa8DnjG0x-Dj-Ko09YcKFDsc58L4q-PQhpCGvEO9DWjDzEWPUOP1zj7yf4IcQuAZIWsN-atpup2EEDTEm2Ue8pLZ9gUYw6haLjKoRkIGLJHWj80g945VLB9Er3S6Dh74Mq0lDOcaLurwfy1ZTniyoqKHYg4N3xue7XOjICjkl_Gvnb4NXjhqDp5z1rT3-XLp6aO_Slgs8Z4Za--Em5knv3BUAOz18cjLlP9_NFIguVk8AjjsTERHsk1a-UlFhYsgJr8OErOgzVsDA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME Univariate Analysis

2021-01-20 Thread Boa Sorte Silva, Narlon
External Email - Use Caution

Dear Freesurfer Experts,
Hope this finds you well

I am following the LME tutorial running LME Univariate analysis. I was 
wondering if someone would kindly check my steps below? I wanted to make sure 
specially that my matrix (X) and and contrast (C) were designed accordingly to 
assess group*time interaction.

Study design:
Two groups: 0 = control, 1 = intervention
Time: 0 = baseline, 1 = 6-month follow-up
Outcome of interest: Change in hippocampal volume
Co-Variate: Estimated ICV

Here are the steps I took in Matlab:

# Loading into Matlab Qdec table with 7 columns in this exact order:  fsid, 
fsid-base, time, group, Righ.Hipp, Left.Hipp, estimated_ICV:
Qdec = fReadQdec('qdec-aseg.table.dat');
Qdec = rmQdecCol(Qdec,1);
sID = Qdec(2:end,1);
Qdec = rmQdecCol(Qdec,1);
M = Qdec2num(Qdec);
Y = M(:,3:4);
M = M(:,[1:2 5]); # Here I loaded estimated ICV already into M (as the third 
column), as it will be treated as a covariate later.

# Sorting data according to time
[M,Y,ni] = sortData(M,1,Y,sID);

# Building design matrix X from M, for a simple time by group interaction. Note 
that here, I have the slope column as 1, then I add time and group columns via: 
M(:,1:2), then a column for group*time via: M(:,1).*M(:,2), and finally a 
column for estimated ICV, as the final column in the matrix via: M(:,3). I 
wonder if this is correct?
X = [ones(length(M),1) [M(:, 1:2) M(:,1).*M(:,2) M(:,3)]];

# Determining model parameters, for total hippocampal volume, Left.Hipp, and 
Right.Hipp. Here, since my sample is small (N = 15), I am using 1 random effect 
only.
hipp_vol_stats_tot = lme_fit_FS(X,[1],Y(:,1)+Y(:,2),ni);
hipp_vol_stats_left = lme_fit_FS(X,[1],Y(:,1),ni);
hipp_vol_stats_right = lme_fit_FS(X,[1],Y(:,2),ni);

# Creating contrast (C) matrix for simple group*time interaction controlling 
for estimated ICV. Does this look correct, considering that the last 0 would 
control for estimated ICV?
C = [ 0 0 0 1 0];

# Finally, F test for total, left and right hippocampal volumes
F_C_tot = lme_F(hipp_vol_stats_tot,C);
F_C_left = lme_F(hipp_vol_stats_left,C);
F_C_right = lme_F(hipp_vol_stats_right,C);

Thanks so much for your help!

Nárlon Cássio

Nárlon Cássio Boa Sorte Silva, PhD
CIHR/MSFHR Postdoctoral Research Fellow
Aging, Mobility, and Cognitive Neuroscience Lab
Djavad Mowafaghian Centre for Brain Health
University of British Columbia
Twitter: @BoaNarlon

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] lme models time or time^2

2020-02-25 Thread Knut J Bjuland
External Email - Use Caution

Dear FreeSurfer expert




I have a lme model with 3 timelines where one timeline is baseline. I two 
models y = intercept + time + group + sex + time_at_baseline and y = intercept 
+time +time² + group + sex +time_at_baseline




Both time² and time is significant after FDR. How can I decide which model is 
best?

Knut Jørgen Bjuland
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME Contrast Question

2019-12-04 Thread Hua, Jessica
External Email - Use Caution


Hi FreeSurfer Experts,

I had a question regarding contrasts for univariate LME models.

I am interested in looking at the interaction of alcohol with change in volume 
across two time-points. Included in my model are covariates Gender, ICV, and 
Previous Drinking History.

My X matrix includes 7 columns:
Column 1 = 1s
Column 2 = time
Column 3 = alcohol
Column 4 = time*alcohol
Column 5 =  Gender
Column 6 = ICV
Column 7 = Previous Drinking History

My contrast is C = [0 0 0 1 0 0 0 ].

I have 4 different previous drinking history variables.  However, when I change 
column 7 with my different previous drinking history variables, the F and P 
values for the interaction are the same. Am I setting up my contrasts 
incorrectly?

Best,

Jessica Hua
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] LME model contrast matrix (Diers, Kersten /DZNE)

2019-11-07 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hello Guodong,

On Mi, 2019-11-06 at 11:28 +0800, Liu Guodong wrote:
> External Email - Use Caution
> 
> Hi Kersten,
> 
> Thank you so much for the reply and that helps a lot.
> 
> There are still some questions that I hope you can help me.
> 
> 1.For the first model in you last email, you said 'To get the
> mean for group B, one would need to add the beta weights of the two
> regressors.’. I wonder if the beta weights should be 1 for
> regressors1 and 1 for regressor2, and the mean for group B is
> regressor2 plus regressor1 with the condition the value of group B is
> bigger than group A.

I am not sure if I understand correctly, but I suppose what you have in
mind is the contrast weights rather than the beta weights. 

With beta weights I am referring to the parameters estimated by the
model (beta values), so you can't specify those. With contrast weights
I am referring to the elements of the contrast vector or matrix (often
0, +1, or -1). These are specified by the user and are used to create
weighted sums or differences of the beta weights, which in turn are
evaluated for statistical significance.

In the first model for the t-test that we discussed in the previous
mail, the hypothesis that B>A would be assessed by a contrast vector
like [ 0 +1 ], assuming that the first regressor is the intercept and
the second regressor codes 1 for group B and 0 for group A.

Keep in mind that in multi-variable regression models, the
interpretation of (sums or differences) of parameter estimates is
conditional on all other estimates being zero. So in a longitudinal
model, for example, it is not the overall mean of e.g. A or B, but the
mean at time zero.

> 2.Is there any P-value for the lme_fit_FS function to present the
> quality of the fitting?

No, not really. I also don't think that goodness of fit would be
assessed by means of a p-value / hypothesis test, but rather by
computing the R^2 statistic. For the LME tools, this needs to be
calculated manually, I believe.

> 3.As you said before, if I have 3 group A,B,C for this model, and
> group A is reference group, the regressor1 is the mean of group A,
> and regressor2 and 3 reflect the difference between group A and B,C.
> But if I want to know the difference between B and C, what should I
> do. From the F-test, there only have a P-value to reflect how
> different between group B and C, I wonder can I compute a value the
> same as regressor 2 to reflect the difference?

To get the difference between two non-reference groups, you would
specify a 'difference contrast', which has -1 and +1 at the appropriate
columns, and zeros otherwise.

Best regards,

Kersten

> Thanks!
> 
> Best regards,
> Guodong
> 
> > 
> > 
> > --
> > 
> > Date: Tue, 5 Nov 2019 09:48:06 +
> > From: "Diers, Kersten /DZNE" 
> > Subject: Re: [Freesurfer] LME model contrast matrix (Diers, Kersten
> > /DZNE)
> > To: "freesurfer@nmr.mgh.harvard.edu"  > u>
> > Message-ID: <1572947286.4016.34.ca...@dzne.de>
> > Content-Type: text/plain; charset="utf-8"
> > 
> >    External Email - Use Caution
> > 
> > Hello Guodong,
> > 
> > consider as an analogy a two-sample t-test, where we simply compare
> > two
> > groups A and B:
> > 
> > If formulated as a regression problem, a commonly used model matrix
> > for
> > this test (but others are possible, too) will consist of two
> > columns,
> > one being all ones (the intercept), the other being zero for group
> > A
> > and one for group B.
> > 
> > The beta value for the first regressor should reflect the mean for
> > group A (which is chosen as the reference group), and the beta
> > value
> > for the second regressor should reflect the difference between
> > group A
> > and B, which is the primary interest for this comparison. To get
> > the
> > mean for group B, one would need to add the beta weights of the two
> > regressors.
> > 
> > The LME design matrices follow the same logic.
> > 
> > Alternatively, as said before, other design matrices are possible.
> > In
> > the above toy example, one could also use a matrix with two
> > columns,
> > where column 1 is one for group A and zero for group B, and column
> > 2 is
> > zero for group A and one for group B, thus omitting the overall
> > intercept. Then, the beta weights would directly reflect the means
> > of A
> > and B. To get the difference between groups A and B, one would need
> > to
> > subtract the beta weights.
> > 
> > Mathematically, the 

Re: [Freesurfer] LME model contrast matrix (Diers, Kersten /DZNE)

2019-11-05 Thread Liu Guodong
External Email - Use Caution

Hi Kersten,

Thank you so much for the reply and that helps a lot.

There are still some questions that I hope you can help me.

1.For the first model in you last email, you said 'To get the
mean for group B, one would need to add the beta weights of the two 
regressors.’. I wonder if the beta weights should be 1 for regressors1 and 1 
for regressor2, and the mean for group B is regressor2 plus regressor1 with the 
condition the value of group B is bigger than group A.

2.Is there any P-value for the lme_fit_FS function to present the quality of 
the fitting?

3.As you said before, if I have 3 group A,B,C for this model, and group A is 
reference group, the regressor1 is the mean of group A, and regressor2 and 3 
reflect the difference between group A and B,C. But if I want to know the 
difference between B and C, what should I do. From the F-test, there only have 
a P-value to reflect how different between group B and C, I wonder can I 
compute a value the same as regressor 2 to reflect the difference?

Thanks!

Best regards,
Guodong

> 
> --
> 
> Date: Tue, 5 Nov 2019 09:48:06 +
> From: "Diers, Kersten /DZNE" 
> Subject: Re: [Freesurfer] LME model contrast matrix (Diers, Kersten
>   /DZNE)
> To: "freesurfer@nmr.mgh.harvard.edu" 
> Message-ID: <1572947286.4016.34.ca...@dzne.de>
> Content-Type: text/plain; charset="utf-8"
> 
>External Email - Use Caution
> 
> Hello Guodong,
> 
> consider as an analogy a two-sample t-test, where we simply compare two
> groups A and B:
> 
> If formulated as a regression problem, a commonly used model matrix for
> this test (but others are possible, too) will consist of two columns,
> one being all ones (the intercept), the other being zero for group A
> and one for group B.
> 
> The beta value for the first regressor should reflect the mean for
> group A (which is chosen as the reference group), and the beta value
> for the second regressor should reflect the difference between group A
> and B, which is the primary interest for this comparison. To get the
> mean for group B, one would need to add the beta weights of the two
> regressors.
> 
> The LME design matrices follow the same logic.
> 
> Alternatively, as said before, other design matrices are possible. In
> the above toy example, one could also use a matrix with two columns,
> where column 1 is one for group A and zero for group B, and column 2 is
> zero for group A and one for group B, thus omitting the overall
> intercept. Then, the beta weights would directly reflect the means of A
> and B. To get the difference between groups A and B, one would need to
> subtract the beta weights.
> 
> Mathematically, the two above models are equivalent. This also implies
> that one should not specify a model where there is an intercept, a
> regressor for group A, and a regressor for group B, because in this
> case, the regressors would be linearly dependent. Since having an
> overall intercept is advantageous (especially in more complex modelling
> situations than this toy example), the first model is the preferred
> one.
> 
> Hope this helps,
> 
> Kersten
> 
> 
> On So, 2019-11-03 at 16:33 +0800, Liu Guodong wrote:
>> External Email - Use Caution
>> 
>> Dear Kersten:?
>> The ?1 and ?2 in the tutorial model is the regressing coefficients
>> for all the subjects not only for the control subjects because all
>> the intercept are one. I wonder why the reference group is control
>> group in this case?
>> 
>> Thanks in advance.
>> 
>> Best regards,
>> Guodong
>>> 
>>> Date: Thu, 24 Oct 2019 08:06:28 +
>>> From: "Diers, Kersten /DZNE" 
>>> Subject: Re: [Freesurfer] LME model contrast matrix
>>> To: "freesurfer@nmr.mgh.harvard.edu" >> u>
>>> Message-ID: <1571904388.10840.18.ca...@dzne.de>
>>> Content-Type: text/plain; charset="utf-8"
>>> 
>>> ???External Email - Use Caution
>>> 
>>> Hi Guodong,
>>> 
>>> On Di, 2019-10-22 at 16:05 +0800, Liu Guodong wrote:
>>>> 
>>>> External Email - Use Caution
>>>> 
>>>> Hello FreeSurfer Developers,
>>>> 
>>>> I'm doing the LME tutorial, and I have some questions .
>>>> 
>>>> 1. Why don?t we need to put the healthy controls in the designed
>>>> matrix X?
>>> Because that would be mathematically redundant, given the intercept
>>> and
>>> the other group regressors.?
>>> 
>>> In general

Re: [Freesurfer] LME model contrast matrix (Diers, Kersten /DZNE)

2019-11-05 Thread Diers, Kersten /DZNE
gt; > To: "freesurfer@nmr.mgh.harvard.edu"  > u>
> > Message-ID: 
> > Content-Type: text/plain; charset="utf-8"
> > 
> > Hi Lauri, I think this comes down to whether you start counting
> > from 0 
> > or 1. FSFAST starts from 0, so the time of? time point N is N*TR.
> > The 
> > maximum you can have is N=208, and so the max time would be 478.4.
> > Your 
> > 480.7 exceeds this limit.
> > doug
> > 
> > On 10/23/2019 1:34 PM, Lauri Tuominen wrote:
> > > 
> > > External Email - Use Caution
> > > 
> > > Dear Freesurfers,
> > > I am running resting state analysis. I have TR 2.3, and 209 time
> > > points/frames, total length of the scan 483 seconds. I don?t drop
> > > any frames from the beginning ( nskip = 0 ).
> > > 
> > > For one subject, the last two time points are motion outliers. So
> > > my tpef file includes numbers 478.4 and 480.7. When I run
> > > selxavg3-sess, I get the error time point exlusion file exceed
> > > nframes.
> > > 
> > > I can?t figure out where the bug might be. So once again I would
> > > really appreciate your help!
> > > Thanks
> > > Lauri Tuominen
> > > 
> > > 
> > > ___
> > > Freesurfer mailing list
> > > Freesurfer@nmr.mgh.harvard.edu
> > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > 
> > 
> > 
> > --
> > 
> > Message: 3
> > Date: Thu, 24 Oct 2019 03:29:14 +
> > From: "Greve, Douglas N.,Ph.D." 
> > Subject: Re: [Freesurfer] Learning fsfast tutorial
> > To: "freesurfer@nmr.mgh.harvard.edu"  > u>
> > Message-ID: 
> > Content-Type: text/plain; charset="windows-1252"
> > 
> > look in sess01/bold, you should see 001 and 002. Do you?
> > 
> > On 10/22/2019 9:40 AM, Renew Andrade wrote:
> > 
> >    External Email - Use Caution
> > 
> > Dear experts:
> > I am trying to run preproc-sess -s sess01 -fsd bold -stc up
> > -surface fsaverage lhrh -mni305 -fwhm 5 -per-run
> > But the outcome is ERROR: no run directories found.
> > 
> > What could be wrong?
> > If you need more information let me know!
> > 
> > Sincerely,
> > Andrade.
> > 
> > 
> > 
> > ___
> > Freesurfer mailing list
> > Freesurfer@nmr.mgh.harvard.edu<mailto:freesur...@nmr.mgh.harvard.ed
> > u>
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > 
> > -- next part --
> > An HTML attachment was scrubbed...
> > URL: http://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/attachmen
> > ts/20191024/4f742281/attachment-0001.html 
> > 
> > --
> > 
> > Message: 4
> > Date: Thu, 24 Oct 2019 08:06:28 +
> > From: "Diers, Kersten /DZNE" 
> > Subject: Re: [Freesurfer] LME model contrast matrix
> > To: "freesurfer@nmr.mgh.harvard.edu"  > u>
> > Message-ID: <1571904388.10840.18.ca...@dzne.de>
> > Content-Type: text/plain; charset="utf-8"
> > 
> >    External Email - Use Caution
> > 
> > Hi Guodong,
> > 
> > On Di, 2019-10-22 at 16:05 +0800, Liu Guodong wrote:
> > > 
> > > External Email - Use Caution
> > > 
> > > Hello FreeSurfer Developers,
> > > 
> > > I'm doing the LME tutorial, and I have some questions .
> > > 
> > > 1. Why don?t we need to put the healthy controls in the designed
> > > matrix X?
> > Because that would be mathematically redundant, given the intercept
> > and
> > the other group regressors.?
> > 
> > In general, one chooses a reference group (in this case, controls),
> > and
> > this group is implicitly modeled (by the intercept). The other
> > group
> > regressors will then model the difference between that particular
> > group
> > and the reference group.
> > 
> > > 
> > > 2. What?s the interpretation of the first row of the contrast
> > > matrix
> > > [1 0 0 0 0], does it mean first group minus healthy group?
> > I assume that we are talking about the first example, i.e. the
> > simple
> > univariate case (not mass-univariate).
> > 
> > Just to be precise, the first row of the contrast matrix would be
> > [ 0 0 0 1 0 0 0

Re: [Freesurfer] LME model contrast matrix (Diers, Kersten /DZNE)

2019-11-03 Thread Liu Guodong
ed more information let me know!
> 
> Sincerely,
> Andrade.
> 
> 
> 
> ___________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu>
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> -- next part --
> An HTML attachment was scrubbed...
> URL: 
> http://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/attachments/20191024/4f742281/attachment-0001.html
>  
> 
> --
> 
> Message: 4
> Date: Thu, 24 Oct 2019 08:06:28 +
> From: "Diers, Kersten /DZNE" 
> Subject: Re: [Freesurfer] LME model contrast matrix
> To: "freesurfer@nmr.mgh.harvard.edu" 
> Message-ID: <1571904388.10840.18.ca...@dzne.de>
> Content-Type: text/plain; charset="utf-8"
> 
>External Email - Use Caution
> 
> Hi Guodong,
> 
> On Di, 2019-10-22 at 16:05 +0800, Liu Guodong wrote:
>> External Email - Use Caution
>> 
>> Hello FreeSurfer Developers,
>> 
>> I'm doing the LME tutorial, and I have some questions .
>> 
>> 1. Why don?t we need to put the healthy controls in the designed
>> matrix X?
> 
> Because that would be mathematically redundant, given the intercept and
> the other group regressors.?
> 
> In general, one chooses a reference group (in this case, controls), and
> this group is implicitly modeled (by the intercept). The other group
> regressors will then model the difference between that particular group
> and the reference group.
> 
>> 2. What?s the interpretation of the first row of the contrast matrix
>> [1 0 0 0 0], does it mean first group minus healthy group?
> 
> I assume that we are talking about the first example, i.e. the simple
> univariate case (not mass-univariate).
> 
> Just to be precise, the first row of the contrast matrix would be
> [ 0 0 0 1 0 0 0 0 0 0 0 0 0 0], right?
> 
> The fourth regressor (which this contrasts tests) is "colum 3 * time",
> i.e. the interaction between the first group and time. This would
> indicate to which extent the slope across time in this group is
> different from the slope of the reference group.
> 
>> 3. There is a pvalue and a vector sgn from the result of F-test, I
>> know the interpretation of the sgn, but I don?t know the hypothesis
>> of the pvalue, could you please help me with that?
> 
> Strictly speaking, we test (and try to reject) the null hypothesis that
> the ?parameter estimate (or a linear combination of parameter
> estimates) is zero.
> 
> Best regards,
> 
> Kersten
> 
>> Thanks in advance!
>> 
>> Best regards,
>> Guodong
>> 
>> 
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> 
> 
> --
> 
> Message: 5
> Date: Thu, 24 Oct 2019 15:43:37 +0200
> From: Renew Andrade 
> Subject: Re: [Freesurfer] Learning fsfast tutorial
> To: freesurfer@nmr.mgh.harvard.edu
> Message-ID: <9a4b8c42-98ce-4771-83b2-4ca66dfdf...@yahoo.com>
> Content-Type: text/plain; charset="utf-8"
> 
>External Email - Use Caution
> 
> Dear FreeSurfer experts:
> I am trying to use my own data so I don?t have the same tutorial structure. I 
> do keep the folder structure as similar as possible in order for FreeSurfer 
> to run but I cannot have different sessions for example I just have resting 
> or bold but not both. Is it a problem when running this analysis?
> 
> 
> This is my directory structure
> 
> 
> ?  ~ cd /Users/andraderenew/Downloads/2 
> ?  2 git:(master) ? ls
> rest
> ?  2 git:(master) ? cd rest 
> ?  rest git:(master) ? ls
> dti_FA.nii.gz dti_L2.nii.gz dti_MD.nii.gz dti_S0.nii.gz dti_V2.nii.gz
> dti_L1.nii.gz dti_L3.nii.gz dti_MO.nii.gz dti_V1.nii.gz dti_V3.nii.gz
> ?  rest git:(master) ? 
> 
> Sincerely,
> Andrade.
> 
> 
> look in sess01/bold, you should see 001 and 002. Do you?
> 
> On 10/22/2019 9:40 AM, Renew Andrade wrote:
>External Email - Use Caution
> 
> Dear experts:
> I am trying to run preproc-sess -s sess01 -fsd bold -stc up -surface 
> fsaverage 
> lhrh -mni305 -fwhm 5 -per-run
> But the outcome is ERROR: no run directories found.
> 
> What could be wrong?
> If you need more information let me know!
> 
> Sincerely,
> Andrade.
> 
> 
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mg

Re: [Freesurfer] LME model contrast matrix

2019-10-24 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hi Guodong,

On Di, 2019-10-22 at 16:05 +0800, Liu Guodong wrote:
> External Email - Use Caution
> 
> Hello FreeSurfer Developers,
> 
> I'm doing the LME tutorial, and I have some questions .
> 
> 1. Why don’t we need to put the healthy controls in the designed
> matrix X?

Because that would be mathematically redundant, given the intercept and
the other group regressors. 

In general, one chooses a reference group (in this case, controls), and
this group is implicitly modeled (by the intercept). The other group
regressors will then model the difference between that particular group
and the reference group.

> 2. What’s the interpretation of the first row of the contrast matrix
> [1 0 0 0 0], does it mean first group minus healthy group?

I assume that we are talking about the first example, i.e. the simple
univariate case (not mass-univariate).

Just to be precise, the first row of the contrast matrix would be
[ 0 0 0 1 0 0 0 0 0 0 0 0 0 0], right?

The fourth regressor (which this contrasts tests) is "colum 3 * time",
i.e. the interaction between the first group and time. This would
indicate to which extent the slope across time in this group is
different from the slope of the reference group.

> 3. There is a pvalue and a vector sgn from the result of F-test, I
> know the interpretation of the sgn, but I don’t know the hypothesis
> of the pvalue, could you please help me with that?

Strictly speaking, we test (and try to reject) the null hypothesis that
the  parameter estimate (or a linear combination of parameter
estimates) is zero.

Best regards,

Kersten

> Thanks in advance!
> 
> Best regards,
> Guodong
> 
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME model contrast matrix

2019-10-22 Thread Liu Guodong
External Email - Use Caution

Hello FreeSurfer Developers,

I'm doing the LME tutorial, and I have some questions .

1. Why don’t we need to put the healthy controls in the designed matrix X?

2. What’s the interpretation of the first row of the contrast matrix [1 0 0 0 
0], does it mean first group minus healthy group?

3. There is a pvalue and a vector sgn from the result of F-test, I know the 
interpretation of the sgn, but I don’t know the hypothesis of the pvalue, could 
you please help me with that?

Thanks in advance!

Best regards,
Guodong


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] Resending question about Freesurfer LME analysis

2019-07-23 Thread Diers, Kersten /DZNE
External Email - Use Caution

... and a second thought is that a comparison with the results from the 
lme_mass_FDR() function, i.e. traditional FDR instead of FDR2, might also be 
worthwile.

Regards,

Kersten

On Mo, 2019-07-22 at 10:45 +1000, Bronwyn Overs wrote:

External Email - Use Caution

Dear Freesurfer Mailing list,

I didn't receive any respondes to my below query so I'm re-sending in the hope 
that someone can assist.


Kind regards,


Bronwyn Overs

Research Assistant

[cid:1563867787.23942.2.camel@dzne.de]


Neuroscience Research Australia
Margarete Ainsworth Building
Barker Street Randwick Sydney NSW 2031 Australia
M 0411 308 769 T +61 2 9399 1725


neura.edu.au <http://neura.edu.au/>


Twitter<https://twitter.com/neuraustralia> | 
Facebook<https://www.facebook.com/NeuroscienceResearchAustralia> | 
Subscribe<http://www.neura.edu.au/help-research/subscribe>




From: "Bronwyn Overs" 
To: "Freesurfer support list" 
Sent: Tuesday, July 16, 2019 11:27:48 AM
Subject: Fwd: Question about Freesurfer LME analysis

Dear Freesurfer Mailing list,

I have run a mass-univariate spatiotemporal model using 'lme_mass_fit_EMinit' 
and then applied an FDR correction across both hemispheres (syntax provided 
below). On completion I realised that most of the corrected p-values for my 
main and interaction effects were well above the alpha of 0.05. The corrected 
p-value thresholds in log base 10 format are included in the attached figure 
and summarised below.

Summary of p-value thresholds in attached images:
Figure

Key

Log10P

P

Figure 1

A1

-1.193

0.064


A2

-0.695

0.202


B1

-0.969

0.107


B2

-0.243

0.571


C1

-0.195

0.638


C2

-0.001

0.998

Figure 2

A

-2.663

0.002


B

-1.295

0.051


I have no idea why this has happened and would greatly appreciate any insight 
you can provide. I would also note that the same issue occurred in a model 
where we exclude all subjects with only a single time-point. However, it did 
not occur when we included only Caucasians in our analysis and excluded the two 
dummy coded ethnicity covariates. This leads me to think its something to do 
with the complexity of the model, but I cannot understand why the error is only 
occurring when we correct for multiple comparisons. I have provided the details 
of sample and methods below.

Sample
Our sample includes 112 controls subjects, and 106 at-risk subjects 
(individuals with a first degree relative  of BD but not personal history of 
BD). All subjects are aged between 12 and 30 years. 153 or these subjects have 
2 time-points (77 control, 76 at-risk), while the remaining 65 individuals have 
only 1 MRI time-point. We also have mixed ethnicites - 165 Caucasians, 23 
Asians, and 30 mixed (Asians-Caucasians).

Analysis Design
The QDEC file contains the following 6 variables:
1. Y (years between scans)
2. A (baseline age)
3. G (group, 1=case, 0=control)
4. S (sex, 1=female, 0=male)
5. E1 (Ethnicity 1, 1=asian, 0=other)
6. E2 (Ethnicity 1, 1=mixed-asian-caucasian, 0=other)

Design matrix: [ones(length(M),1) M M(:,1).*M(:,3)]
   i.e. main effects for each of the qdec variables + an 
interaction term for years X group
DVs: Cortical thickness, area and volume
Model: Mass-univariate spatiotemporal model using 'lme_mass_fit_EMinit'
CODE:
% Read in surface files
[Y,mri] = fs_read_Y(mgh);
% Read in qdec file
Qdec = fReadQdec(qdec);
% Remove fsid from qdec
Qdec = rmQdecCol(Qdec,1);
% Store col 1 (fsid-base) in sID variable
sID = Qdec(2:end,1);
% Remove col 1 (fsid-base) from Qdec array
Qdec = rmQdecCol(Qdec,1);
% Convert Qdec to numeric matrix M
M = Qdec2num(Qdec);
% Sort data and evaluate design matrix
[M,Y,ni] = sortData(M,1,Y,sID);
X = eval([ones(length(M),1) M M(:,1).*M(:,3)])
% Compute vertex-wise temporal covariance estimates.
[Th0, Re] = lme_mass_fit_EMinit(X,[1],Y,ni,cortex,3);
%Segmentation and model fitting.
[Rgs, RgMeans, stats] = fit(Th0, Re, [1], sphere, cortex, X, Y, 
ni);
%Check surfaces.
surfcomp(Th0, RgMeans, sphere, fig1, fig2)
Correction for multiple comparisons: FDR across both hemispheres
CODE:
 P = [ F_lhstats.pval(lhcortex) F_rhstats.pval(rhcortex) ];
 G = [ F_lhstats.sgn(lhcortex) F_rhstats.sgn(rhcortex) ];
 [detvtx, sided_pval, pth] = lme_mass_FDR2(P,G,[],0.05,0);
 pcor = -log10(pth);
 thrlh(r,2) = {pcor};
 thrrh(r,2) = {pcor};
 [~,dc] = size(detvtx);
 dvtx(r,2) = {dc};



Kind regard

Re: [Freesurfer] Resending question about Freesurfer LME analysis

2019-07-22 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hi Bronwyn,


sorry for the late reply, and thanks for the detailed mail.


I have to admit that at the moment I do not see anything obvious.


If you can share it, you might upload a Matlab mat file with one or more 
'F_lhstats' and 'F_rhstats' examples to the Freesurfer FileDrop at 
https://gate.nmr.mgh.harvard.edu/filedrop2/ so that we can take a closer look.


Within the FileDrop interface, you'll have to specify an addressee at the MGH: 
please direct it to Martin Reuter (mreu...@nmr.mgh.harvard.edu) with whom I am 
working.


Best regards,


Kersten



From: freesurfer-boun...@nmr.mgh.harvard.edu 
 on behalf of Bronwyn Overs 

Sent: Monday, July 22, 2019 2:45 AM
To: Freesurfer support list
Subject: [Freesurfer] Resending question about Freesurfer LME analysis


External Email - Use Caution

Dear Freesurfer Mailing list,

I didn't receive any respondes to my below query so I'm re-sending in the hope 
that someone can assist.


Kind regards,


Bronwyn Overs

Research Assistant

[cid:5f129eac0ba9d25a5b478c0f175d2b23f1bf1f0e@zimbra]


Neuroscience Research Australia
Margarete Ainsworth Building
Barker Street Randwick Sydney NSW 2031 Australia
M 0411 308 769 T +61 2 9399 1725


neura.edu.au <http://neura.edu.au/>


Twitter<https://twitter.com/neuraustralia> | 
Facebook<https://www.facebook.com/NeuroscienceResearchAustralia> | 
Subscribe<http://www.neura.edu.au/help-research/subscribe>




From: "Bronwyn Overs" 
To: "Freesurfer support list" 
Sent: Tuesday, July 16, 2019 11:27:48 AM
Subject: Fwd: Question about Freesurfer LME analysis

Dear Freesurfer Mailing list,

I have run a mass-univariate spatiotemporal model using 'lme_mass_fit_EMinit' 
and then applied an FDR correction across both hemispheres (syntax provided 
below). On completion I realised that most of the corrected p-values for my 
main and interaction effects were well above the alpha of 0.05. The corrected 
p-value thresholds in log base 10 format are included in the attached figure 
and summarised below.

Summary of p-value thresholds in attached images:
Figure

Key

Log10P

P

Figure 1

A1

-1.193

0.064


A2

-0.695

0.202


B1

-0.969

0.107


B2

-0.243

0.571


C1

-0.195

0.638


C2

-0.001

0.998

Figure 2

A

-2.663

0.002


B

-1.295

0.051


I have no idea why this has happened and would greatly appreciate any insight 
you can provide. I would also note that the same issue occurred in a model 
where we exclude all subjects with only a single time-point. However, it did 
not occur when we included only Caucasians in our analysis and excluded the two 
dummy coded ethnicity covariates. This leads me to think its something to do 
with the complexity of the model, but I cannot understand why the error is only 
occurring when we correct for multiple comparisons. I have provided the details 
of sample and methods below.

Sample
Our sample includes 112 controls subjects, and 106 at-risk subjects 
(individuals with a first degree relative  of BD but not personal history of 
BD). All subjects are aged between 12 and 30 years. 153 or these subjects have 
2 time-points (77 control, 76 at-risk), while the remaining 65 individuals have 
only 1 MRI time-point. We also have mixed ethnicites - 165 Caucasians, 23 
Asians, and 30 mixed (Asians-Caucasians).

Analysis Design
The QDEC file contains the following 6 variables:
1. Y (years between scans)
2. A (baseline age)
3. G (group, 1=case, 0=control)
4. S (sex, 1=female, 0=male)
5. E1 (Ethnicity 1, 1=asian, 0=other)
6. E2 (Ethnicity 1, 1=mixed-asian-caucasian, 0=other)

Design matrix: [ones(length(M),1) M M(:,1).*M(:,3)]
   i.e. main effects for each of the qdec variables + an 
interaction term for years X group
DVs: Cortical thickness, area and volume
Model: Mass-univariate spatiotemporal model using 'lme_mass_fit_EMinit'
CODE:
% Read in surface files
[Y,mri] = fs_read_Y(mgh);
% Read in qdec file
Qdec = fReadQdec(qdec);
% Remove fsid from qdec
Qdec = rmQdecCol(Qdec,1);
% Store col 1 (fsid-base) in sID variable
sID = Qdec(2:end,1);
% Remove col 1 (fsid-base) from Qdec array
Qdec = rmQdecCol(Qdec,1);
% Convert Qdec to numeric matrix M
M = Qdec2num(Qdec);
% Sort data and evaluate design matrix
[M,Y,ni] = sortData(M,1,Y,sID);
X = eval([ones(length(M),1) M M(:,1).*M(:,3)])
% Compute vertex-wise temporal covariance estimates.
[Th0, Re] = lme_mass_fit_EMinit(X,[1],Y,ni,cortex,3);
%Segmentation and model fitting.
[Rgs, RgMeans, stats] = fit(Th0, Re, [1], sphere, cortex, X, Y, 
ni);
%Check sur

[Freesurfer] LME - Monte Carlo

2019-07-01 Thread tom parker
External Email - Use Caution

Dear FreeSurfers,

I was reading the wiki documents about how to run LME analyses in
FreeSurfer.
I found that one of the disadvantages is that, at the moment, it only
allows FDR corrections to be applied for multiple comparisons.

I have 2 patient groups that show cortical thinning compared to controls at
baseline when I correct with Monte Carlo but nothing survives with FDR.
Now, I would like to see if these cortical thinning patterns change over
time so I thought I should keep things consistent and use Monte Carlo for
the longitudinal analysis as well.

Is there any way of using Monte Carlo for LME? I read some suggestions in
emails that were sent 2 years ago but I was wondering if there are any
updates or if there is a guide with recommended steps?

Thank you so much!
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] LME

2019-01-31 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hi Getaneh,

please find my responses inline.


On Di, 2019-01-29 at 14:18 -0600, Getaneh Bayu wrote:

External Email - Use Caution

Dear Freesurfer Experts,







I have a question about how to interpret  cortical thickness difference between 
groups using LME MATLAB tools.





I have three groups(g0, g1, and g2) and five time points(t= 0,0.5, 1,2,3).







I am trying to use  LME model  with random effects y-int and time from the base 
line.



Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:



Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ 



To see the difference between group g0 and group g1,  I constructed the 
following contrast matrix using the tutorial provided in LME MATLAB tools



C = [zeros(1,3) [1 0 0] zeros(1,4)];

CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];



Based on the tutorial I run the following functions.



rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere); F_rhstats = 
lme_mass_F(rhstats,CM); 
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');



nv=length(rhstats);

Beta2 = zeros(1,nv);

for i=1:nv

  if ~isempty(rhstats(i).Bhat)

  Beta2(i) = rhstats(i).Bhat(2);

   end;

end;



rhmri1 = rhmri;

rhmri1.volsz(4) = 1;

fs_write_Y(Beta2,rhmri1,'rhBeta2.mgh');



[detvtx,sided_pval,pth] = 
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);



fs_write_Y(sided_pval,rhmri1,'spval.mgh');





When I view sig.mgh using tksurfer I see regions with red and blue color.





1) Does the result shows the oveall change for all the five time points?

Your contrast vector means that you will be evaluating B4, i.e. the interaction 
between group 1 and time, or - put differently - the difference in slopes for 
groups g0 and g1. More precisely, is there a greater (this can also mean: less 
negative) slope in group 1 than in group 0. All time points will contribute to 
this effect.


2) How do I know the difference between the two groups for each 5 time points?

In my eyes, this model cannot be used for testing group differences at each 
single time point, since time is treated as a continous variable. This is in 
contrast to an ANOVA, where we would treat timepoints as a categorical 
variable. You might want to consider conducting separate (non-LME) analyses for 
each time-point.


3) Does red means thickness of group A is lgreater than thickness of group B?

That depends on the settings in your GUI, on how the model was specified, and 
how the contrasts were set up, so there is no general answer in my opinion.

Note, however, that although the LME toolbox conducts F-tests, which are 
direction-less, the direction can be inferred from the F- or p-maps, since the 
LME toolbox attaches a sign to them when writing with the fs_write_stats.m 
function. This sign depends on how the contrast was formulated and also on the 
sign of the beta coefficient. Essentially, it will be the sign of the value 
resulting from the multiplication of the contrast vector with the beta 
coefficients vector.
For example, if the contrast vector contains a single positive value (i.e., +1) 
and zeros otherwise, and if the beta coefficient is also positive, then the 
sign will be positive. If the same contrast results in a negative beta 
coefficient, the sign will be negative. The sign will also be negative for the 
converse scenario of a negative contrast value (i.e., -1) and a positive beta 
coefficient. The sign will again be positive for a negative contrast value in 
combination with a negative beta coefficient.


4) what does rhBeta2.mgh and spval.mgh tell us? How can I extract the 
information from the file?

The first file will contain the second beta coefficient  of the model, note the 
Bhat(2) indexing in your code. The second file contains the p-values as 
returned by lme_mass_FDR2. Both the beta coefficients and the p-values can be 
visualized by loading a surface in the 'freeview' GUI, and choosing these files 
as overlays (Overlay --> load generic).

Best regards,

Kersten



With regards



Getaneh

--



--



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME

2019-01-29 Thread Getaneh Bayu
External Email - Use Caution

Dear Freesurfer Experts,







I have a question about how to interpret  cortical thickness difference
between groups using LME MATLAB tools.





I have three groups(g0, g1, and g2) and five time points(t= 0,0.5, 1,2,3).







I am trying to use  LME model  with random effects y-int and time from the
base line.



Based on the LME tutorial  and the questions and answers from Freesurfer
support list:



Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ 



To see the difference between group g0 and group g1,  I constructed the
following contrast matrix using the tutorial provided in LME MATLAB tools



C = [zeros(1,3) [1 0 0] zeros(1,4)];

CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];



Based on the tutorial I run the following functions.



rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere); F_rhstats
= lme_mass_F(rhstats,CM);
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');



nv=length(rhstats);

Beta2 = zeros(1,nv);

for i=1:nv

  if ~isempty(rhstats(i).Bhat)

  Beta2(i) = rhstats(i).Bhat(2);

   end;

end;



rhmri1 = rhmri;

rhmri1.volsz(4) = 1;

fs_write_Y(Beta2,rhmri1,'rhBeta2.mgh');



[detvtx,sided_pval,pth] =
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);



fs_write_Y(sided_pval,rhmri1,'spval.mgh');





When I view sig.mgh using tksurfer I see regions with red and blue color.





1) Does the result shows the oveall change for all the five time points?

2) How do I know the difference between the two groups for each 5 time
points?

3) Does red means thickness of group A is lgreater than thickness of group
B?

4) what does rhBeta2.mgh and spval.mgh tell us? How can I extract the
information from the file?



 With regards



Getaneh



-- 




--
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME

2019-01-29 Thread Tefera, Getaneh B
External Email - Use Caution

Dear Freesurfer Experts,







I have a question about how to interpret  cortical thickness difference between 
groups using LME MATLAB tools.





I have three groups(g0, g1, and g2) and five time points(t= 0,0.5, 1,2,3).







I am trying to use  LME model  with random effects y-int and time from the base 
line.



Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:



Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ 



To see the difference between group g0 and group g1,  I constructed the 
following contrast matrix using the tutorial provided in LME MATLAB tools



C = [zeros(1,3) [1 0 0] zeros(1,4)];

CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];



Based on the tutorial I run the following functions.



rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere); F_rhstats = 
lme_mass_F(rhstats,CM); 
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');



nv=length(rhstats);

Beta2 = zeros(1,nv);

for i=1:nv

  if ~isempty(rhstats(i).Bhat)

  Beta2(i) = rhstats(i).Bhat(2);

   end;

end;



rhmri1 = rhmri;

rhmri1.volsz(4) = 1;

fs_write_Y(Beta2,rhmri1,'rhBeta2.mgh');



[detvtx,sided_pval,pth] = 
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);



fs_write_Y(sided_pval,rhmri1,'spval.mgh');





When I view sig.mgh using tksurfer I see regions with red and blue color.





1) Does the result shows the oveall change for all the five time points?

2) How do I know the difference between the two groups for each 5 time points?

3) Does red means thickness of group A is lgreater than thickness of group B?

4) what does rhBeta2.mgh and spval.mgh tell us? How can I extract the 
information from the file?



 With regards



Getaneh

--



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME MATHLAB tools

2019-01-22 Thread Getaneh Bayu
External Email - Use Caution

Dear Freesurfer Experts,







I have a question about how to interpret  cortical thickness difference
between groups using LME MATLAB tools.





I have three groups(g0, g1, and g2) and five time points(t= 0,0.5, 1,2,3).







I am trying to use  LME model  with random effects y-int and time from the
base line.



Based on the LME tutorial  and the questions and answers from Freesurfer
support list:



Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ 



To see the difference between group g0 and group g1,  I constructed the
following contrast matrix using the tutorial provided in LME MATLAB tools



C = [zeros(1,3) [1 0 0] zeros(1,4)];

CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];



Based on the tutorial I run the following functions.



rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere); F_rhstats
= lme_mass_F(rhstats,CM);
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');



nv=length(rhstats);

Beta2 = zeros(1,nv);

for i=1:nv

  if ~isempty(rhstats(i).Bhat)

  Beta2(i) = rhstats(i).Bhat(2);

   end;

end;



rhmri1 = rhmri;

rhmri1.volsz(4) = 1;

fs_write_Y(Beta2,rhmri1,'rhBeta2.mgh');



[detvtx,sided_pval,pth] =
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);



fs_write_Y(sided_pval,rhmri1,'spval.mgh');





When I view sig.mgh using tksurfer I see regions with red and blue color.





1) Does the result shows the oveall change for all the five time points?

2) How do I know the difference between the two groups for each 5 time
points?

3) Does red means thickness of group A is lgreater than thickness of group
B?

4) what does rhBeta2.mgh and spval.mgh tell us? How can I extract the
information from the file?



 With regards



Getaneh

--
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] LME MATLAB tools

2019-01-22 Thread Tefera, Getaneh B
External Email - Use Caution

Dear Freesurfer Experts,



I have a question about how to interpret  cortical thickness difference between 
groups using LME MATLAB tools.


I have three groups(g0, g1, and g2) and five time points(t= 0,0.5, 1,2,3).



I am trying to use  LME model  with random effects y-int and time from the base 
line.

Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ 

To see the difference between group g0 and group g1,  I constructed the 
following contrast matrix using the tutorial provided in LME MATLAB tools

C = [zeros(1,3) [1 0 0] zeros(1,4)];
CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];

Based on the tutorial I run the following functions.

rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere); 
F_rhstats = lme_mass_F(rhstats,CM); 
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');

nv=length(rhstats);
Beta2 = zeros(1,nv);
for i=1:nv
  if ~isempty(rhstats(i).Bhat)
  Beta2(i) = rhstats(i).Bhat(2);
   end;
end;

rhmri1 = rhmri;
rhmri1.volsz(4) = 1;
fs_write_Y(Beta2,rhmri1,'rhBeta2.mgh');

[detvtx,sided_pval,pth] = 
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);

fs_write_Y(sided_pval,rhmri1,'spval.mgh');


When I view sig.mgh using tksurfer I see regions with red and blue color.


1) Does the result shows the oveall change for all the five time points?
2) How do I know the difference between the two groups for each 5 time points?
3) Does red means thickness of group A is lgreater than thickness of group B?
4) what does rhBeta2.mgh and spval.mgh tell us? How can I extract the 
information from the file?

 With regards

Getaneh


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] LME MATLAB Tools

2019-01-10 Thread Tefera, Getaneh B
External Email - Use Caution

Dear Freesurfer Experts,



I have a question about how to interpret  cortical thickness difference between 
groups using LME MATLAB tools.


I have three groups(g0, g1, and g2) and five time points(t= 0,0.5, 1,2,3).



I am trying to use  LME model  with random effects y-int and time from the base 
line.

Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ 

To see the difference between group g0 and group g1,  I constructed the 
following contrast matrix using the tutorial provided in LME MATLAB tools

C = [zeros(1,3) [1 0 0] zeros(1,4)];
CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];

Based on the tutorial I run the following functions.

rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere);
F_rhstats = lme_mass_F(rhstats,CM);
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');

nv=length(rhstats);
Beta2 = zeros(1,nv);
for i=1:nv
  if ~isempty(rhstats(i).Bhat)
  Beta2(i) = rhstats(i).Bhat(2);
   end;
end;

rhmri1 = rhmri;
rhmri1.volsz(4) = 1;
fs_write_Y(Beta2,rhmri1,'rhBeta2.mgh');

[detvtx,sided_pval,pth] = 
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);

fs_write_Y(sided_pval,rhmri1,'spval.mgh');


When I view sig.mgh using tksurfer I see regions with red and blue color.


1) Does the result shows the oveall change for all the five time points?
2) How do I know the difference between the two groups for each 5 time points?
3) Does red means thickness of group A is larger than thickness of group B?
4) what does rhBeta2.mgh and spval.mgh tell us? How can I extract the 
information from the file?



With regards

Getaneh
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] LME

2019-01-07 Thread Tefera, Getaneh B
External Email - Use Caution

Dear Kersten,

I have a question about how to interpret  cortical thickness difference between 
groups.

I have three groups(A, B, and C) and five time points(t=0,0.5, 1,2,3).

To see the difference between group A and group B,  I constructed the following 
contrast matrix using the tutorial  provided by Freesurfer

C = [zeros(1,3) [1 0 0] zeros(1,4)];
CM.C=[zeros(1,3) [1 0 0] zeros(1,4)];

I run the following functions

rhstats = lme_mass_fit_Rgw(X,[1 2],rhY,ni,rhTh0,rhRgs,rhsphere);
F_rhstats = lme_mass_F(rhstats,CM);
fs_write_fstats(F_rhstats,rhmri,'/backup/cross/rh_AB_cross_sig.mgh','sig');

nv=length(rhstats);
Beta2 = zeros(1,nv);
for i=1:nv
  if ~isempty(rhstats(i).Bhat)
  Beta2(i) = rhstats(i).Bhat(2);
   end;
end;

rhmri1 = rhmri;
rhmri1.volsz(4) = 1;
fs_write_Y(Beta2,rhmri1,'/backup/cross/rh_AB_cross_rhBeta2.mgh');

[detvtx,sided_pval,pth] = 
lme_mass_FDR2(F_rhstats.pval,F_rhstats.sgn,rhcortex,0.05,0);

fs_write_Y(sided_pval,rhmri1,'/backup/cross/rh_AB_cross_spval.mgh');

When I view rh_AB_cross_sig.mgh using tksurfer I see regions with red and blue 
color .

1) How do I know the difference between the two groups for 5 time points?
2) Does red means thickness of group A is larger than thickness of group B?

With regards

Getaneh

-Original Message-
From: freesurfer-boun...@nmr.mgh.harvard.edu 
[mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Diers, Kersten 
/DZNE
Sent: Friday, January 12, 2018 9:50 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

thanks for the additional information.

I suspect that one source of confusion was that we have to distinguish
the univariate and the mass-univariate processing stream in the LME
toolbox. 

The univariate stream is about a single measure like left or right or
bilateral hippocampal volume, whereas the mass-univariate stream does
statistical modeling and testing for all vertices in a hemisphere, for
example to evaluate cortical thickness.

For a large part of my previous replies I was assuming that we are
talking about the univariate stream, where we need to use the
'lme_fit_FS' script. In contrast, the 'lme_mass_fit_Rgw' script, among
others, is used for estimation in the mass-univariate stream.

In that sense, it is not surprising to get error messages when using
the 'lme_fit_FS' script with mass-univariate vertex data as in your
example.

The bad news is that power analysis is only implemented for the
univariate stream, but not the mass-univariate stream. This is because
mass-univariate processing returns thousands of different estimates for
phisq and Dhat, among others, one for each vertex in a hemisphere. We
can get them from the data structure returned by 'lme_mass_fit_Rgw',
but they are simply too many to submit to the power analysis. 

In that sense, I currently see no viable way for power analysis for
cortical thickness data within the LME toolbox unless we can reduce it
to using estimates of a single (as opposed to multi-vertex) effect and
its variabilty.

Likewise, it is not surprising that estimates for Dhat and phisqhat are
different for e.g. the left and right hippocampus. One might speculate,
though, that they should be somewhat similar, and I would be somewhat
suprised if sample size calculations based on them result in very
different sample size estimates.

I have one more remark about the lme_plannedSampleSize script: I would
only recommend using it prospectively. As far as I can see it is not
intended nor can it be meaningfully used retrospectively, i.e. for
assessing the properties of a study that has already been conducted. 

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" 
Reply-to: Freesurfer support list 
To: freesurfer@nmr.mgh.harvard.edu 
Cc: "Tefera, Getaneh B" 
Subject: Re: [Freesurfer] LME
Date: Thu, 11 Jan 2018 21:09:21 +0100

Hi Kersten,

I am sorry I did not make the question more specific.

I have three groups. I want see the power analysis by checking the
sample size calculation for the cortical thickness analysis .

[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


my question is how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject
variability) to calculate the sample size of the pairs  .

Based on your suggestion to get Dhat and phisqhat I have to run "
lme_fit_FS(X,[1,2],y ,ni)"

When I run

lme_fit_FS(X,[1,2],y ,ni), where  Y is obtained from the following

[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh'),  I get error.

Which function with what argument is good to use to find Dhat and
phisqhat?

Are these values the same for left and right cortical thickness data?

I am  sorry for the inconvenience .


with regards

Getaneh



From: freesurfer-boun...@nmr.mgh.harvard.edu  on 

Re: [Freesurfer] LME Univariate pvalue inconsistent

2018-08-29 Thread Martin Reuter
Hi Xiaoyu, 

again (see also other email) you should not run left hemispheres on the
right. This could introduce a processing bias, especially when you
force all left to be healthy and right to be diseased (or vice-versa). 

Instead run your images normally and then for the univariate , simply
compute the diff between the left and right ROI's (always healthy -
diseased). Then do a normal GLM analysis on this signed difference. 

Best, Martin


On Tue, 2018-08-28 at 21:27 +, Wang, Xiaoyu wrote:
> External Email - Use Caution
> Hello Freesurfer Developers,
>  
> I’m attempting to use Univariate LME analysis to compare the
> symptomatic and asymptomatic hemispheres of early stage Parkinson’s
> disease patients.
>  
> I re-organized the data so that the symptomatic hemisphere is the
> left hemisphere and the Asymptomatic is the right (by flipping the
> orig.mgz before recon-all).
>  
> I followed the LME model tutorial for univariate on the freesurfer
> wiki and created my qdec.tabel.dat to have the same layout as in the
> example with group 1 as left hemisphere and group 2 as right
> hemisphere.
>  
> I have a design matrix to do a simple linear model containing a group
> by time interaction with the contrast of [0 0 0 1 0 0]
>  
> After running the F-test however, I noticed that the p-value was
> really inconsistent across atlases.
> I used multiple atlases and noticed that the p-value can be as low as
> 1.00E-30 for many structures.
> This is too good to be true especially since after sending the
> thickness value to a statistician she came back with values greatly
> different from mine.
> However, the Bhat values were similar.
>  
> Can someone give me a hint as to what is going on?
>  
> Xiaoyu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME Univariate pvalue inconsistent

2018-08-28 Thread Wang, Xiaoyu
External Email - Use Caution

Hello Freesurfer Developers,

I'm attempting to use Univariate LME analysis to compare the symptomatic and 
asymptomatic hemispheres of early stage Parkinson's disease patients.

I re-organized the data so that the symptomatic hemisphere is the left 
hemisphere and the Asymptomatic is the right (by flipping the orig.mgz before 
recon-all).

I followed the LME model tutorial for univariate on the freesurfer wiki and 
created my qdec.tabel.dat to have the same layout as in the example with group 
1 as left hemisphere and group 2 as right hemisphere.

I have a design matrix to do a simple linear model containing a group by time 
interaction with the contrast of [0 0 0 1 0 0]

After running the F-test however, I noticed that the p-value was really 
inconsistent across atlases.
I used multiple atlases and noticed that the p-value can be as low as 1.00E-30 
for many structures.
This is too good to be true especially since after sending the thickness value 
to a statistician she came back with values greatly different from mine.
However, the Bhat values were similar.

Can someone give me a hint as to what is going on?

Xiaoyu
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME model and contrast for longitudinal covariate and different scanners

2018-05-30 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hi Donatas,

please find my thoughts in-line.

Best regards,

Kersten

On So, 2018-05-27 at 11:59 +0200, Donatas Sederevicius wrote:

> External Email - Use Caution
> 
> Dear Freesurfer experts,
> 
> I have some doubts while running LME analysis on longitudinal data.
> The main goal is to check whether longitudinal BMI scores have any
> impact on the longitudinal cortical thickness changes. The model I’m
> thinking of is as follows:
> 
> 
> Y_ij = b0 + b1*time_ij + b2*BMI_ij + b3*Skyra_ij + b4*Prisma_ij +
> b5*gender_i + b6*bslAge_i.
> 
> 
> And here is an example design matrix X for the model above:
> 
> 
> --
> 
> ones|time|BMI |Skyra|Prisma|gender|bslAge|
> 
> --
> 
> 1   |0   |0.62|0|0 |0 |1.89  |
> 
> 1   |3.2 |1.56|0|0 |0 |1.89  |
> 
> 1   |7.2 |2.04|1|0 |0 |1.89  |
> 
> --
> 
> 1 |0 |1.1 |0 |0 |1 |1.67 |
> 1 |1.5 |0.9 |0 |0 |1 |1.67 |
> 1 |4 |0.9 |1 |0 |1 |1.67 |
> 1 |5.3 |1.3 |0 |1 |1 |1.67 |
> 
> --
> 
> 1 |0 |0.7 |0 |0 |0 |0.89 |
> 1 |1.2 |0.5 |0 |0 |0 |0.89 |
> 
> --
> 
> 
> Note that BMI and bslAge are z-scored, and there are 3 different
> scanners: Avanto (base), Skyra and Prisma. I’m trying to account for
> differences between scanners as well. For some participants, the
> first two timepoints were scanned with one scanner and the last time
> point with a different one, so it varies within the subject. Do I
> account for the scanner differences in a correct way? Should I add
> interactions with the time variable, as time*Skyra?

Including scanners as you currently do is fine in my eyes.

I would probably also check whether or not results remain stable when
observations after a within-participant scanner change are excluded
from analysis (in order to have the same scanner for the same
participant at all included timepoints).

> Another question. Since BMI is longitudinal, time-variant, should I
> add an interaction with time as well?

In my eyes, if you want to answer the question whether or not the
effect of BMI scores on thickness depends on time, or (vice versa)
whether or not temporal changes in cortical thickness depend on BMI:
then yes, you should add an interaction term of BMI and time - and also
construct and test a corresponding contrast.

> 
> Assuming that the above design matrix is “correct”, I would use the
> following contrast [0 0 1 0 0 0 0] to answer my question whether
> longitudinal BMI scores have any impact on longitudinal cortical
> thickness changes, right?

This contrast will, for your proposed design matrix, test for a
positive relation of BMI and cortical thickness, irrespective of time. 

So this is, if I understood correctly, probably not what you want.
Rather test an interaction term, see above.

> 
> P.S. I’m running spatiotemporal models with one random effect -
> intercept.
> 
> 
> Thank you for the answer!
> 
> 
> Best,
> 
> Donatas
> 
> 
> 
> 
> 
> 
> 

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME model and contrast for longitudinal covariate and different scanners

2018-05-27 Thread Donatas Sederevicius
External Email - Use Caution

Dear Freesurfer experts,

I have some doubts while running LME analysis on longitudinal data. The main 
goal is to check whether longitudinal BMI scores have any impact on the 
longitudinal cortical thickness changes. The model I’m thinking of is as 
follows:


Y_ij = b0 + b1*time_ij + b2*BMI_ij + b3*Skyra_ij + b4*Prisma_ij + b5*gender_i + 
b6*bslAge_i.


And here is an example design matrix X for the model above:


--

ones|time|BMI |Skyra|Prisma|gender|bslAge|

--

1   |0   |0.62|0|0 |0 |1.89  |

1   |3.2 |1.56|0|0 |0 |1.89  |

1   |7.2 |2.04|1|0 |0 |1.89  |

--

1 |0 |1.1 |0 |0 |1 |1.67 |
1 |1.5 |0.9 |0 |0 |1 |1.67 |
1 |4 |0.9 |1 |0 |1 |1.67 |
1 |5.3 |1.3 |0 |1 |1 |1.67 |

--

1 |0 |0.7 |0 |0 |0 |0.89 |
1 |1.2 |0.5 |0 |0 |0 |0.89 |

--


Note that BMI and bslAge are z-scored, and there are 3 different scanners: 
Avanto (base), Skyra and Prisma. I’m trying to account for differences between 
scanners as well. For some participants, the first two timepoints were scanned 
with one scanner and the last time point with a different one, so it varies 
within the subject. Do I account for the scanner differences in a correct way? 
Should I add interactions with the time variable, as time*Skyra?


Another question. Since BMI is longitudinal, time-variant, should I add an 
interaction with time as well?


Assuming that the above design matrix is “correct”, I would use the following 
contrast [0 0 1 0 0 0 0] to answer my question whether longitudinal BMI scores 
have any impact on longitudinal cortical thickness changes, right?


P.S. I’m running spatiotemporal models with one random effect - intercept.


Thank you for the answer!


Best,

Donatas







___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME univariate data

2018-04-17 Thread Diers, Kersten /DZNE
Hello,

this is a little bit hard to tell from the outside. So for the moment I have 
only some general ideas:

Did the algorithm converge in both cases? If not, I would have less confidence 
in the results.

One thing to consider besides the effect size and direction is the variability 
of the estimate (that's in .CovBhat) - and ultimately the significance of the 
effect, which combines estimated effect size and variability. Therefore, a true 
effect size near zero and / or a high variability of the estimate may also 
explain your observations, i.e. the direction change of the estimate.

Also keep in mind that the interpretation of a single beta coefficient assumes 
that all other coefficients in the model are set to zero. This includes 
additional contributions to this effect from groups other than the reference 
group if you have modeled these in additional group*time regressors. For 
exploration purposes, it might be worth to choose another reference group 
and/or to leave out those interaction regressors.

Finally, let us know if you are using the tutorial data for this analysis; we 
may be able to take a closer look in that case.

Best

Kersten

On Do, 2018-04-12 at 20:50 +0200, lanbo Wang wrote:
Dear Kersten,

Thanks for reply. I have new question.
When I set model use total_i_vol_stats = lme_fit_FS(X,[1 2],Y(:,2),ni) and 
total_i_vol_stats = lme_fit_FS(X,[1],Y(:,2),ni).
But Bhat of two models' year have a lot different, for example, with 2 is 
1.2422 without 2 is -0.5737. The direction has already changed. I feel confuse 
about this. Looking for your reply.

Thanks,
Lanbo


On Wed, Mar 28, 2018 at 2:05 PM, Diers, Kersten /DZNE 
> wrote:
Hi

sorry for the delayed response, I was not able to reply during the last
week.

You are right that the F-test provided in the LME toolbox initially
does not provide information about the direction of the effects.

You could do the following:

First, it is always useful to plot the data to get a first impression.
However, if the statistical model also contains additional covariates,
this plot does not completely reflect the effects as estimated by the
model. So this may not give a complete picture.

A second option is to take a look at the sign of the estimated beta
values, which also reflect the direction of the effects. These beta
values are stored in the output of the 'lme_fit_FS' script, e.g.
'total_hipp_vol_stats.Bhat' in the tutorial example. For proper
interpretation, you'd need to relate the beta values and their
corresponding columns of the design matrix, and also take your
contrasts of interest into account. So this is somewhat complicated.

As an alternative, the LME toolbox also provides so-called "signed p-
values". Note that these are not p-values in the conventional sense. A
signed p-value is the sign (-1 or +1) of the scalar product of a row of
the contrast matrix and the vector of the estimated betas, and it can
give information about the direction of a specific effect.

These signed p-values can be accessed from the output of the 'lme_F'
script, see e.g. the 'F_C.sgn' variable for the tutorial example.

There will be as many signed p-values as there are rows in the contrast
matrix, so each signed p-value corresponds to one row of the contrast
matrix.

The interpretation of this signed p-value depends on how the contrast
was formulated:

In a hypothetical example (different from and simpler than the tutorial
example), suppose that one row of a contrast matrix starts like

0 1 -1 ...

and the entries correspond to group1, group2, group3, ..., then a
positive signed p-value will in this particular case indicate that the
difference 'group2 minus group3' is greater than zero, which means that
group2 has greater values than group3. On the other hand, a negative
signed p-value will in this particular case indicate that the
difference 'group2 minus group3' is less than zero, and hence group3
must have greater values than group2.

However, also consider the equally valid alternative that a row of a
contrast matrix starts like

0 -1 1 ...

and the entries again correspond to group1, group2, group3, ..., then a
positive signed p-value will in this particular case indicate that the
difference 'group3 minus group2' is greater than zero, which means that
group3 has greater values than group2. On the other hand, a negative
signed p-value will in this particular case indicate that the
difference 'group3 minus group2' is less than zero, and hence group2
must have greater values than group3.

So the second interpretation is just the opposite as the first one.
This illustrates that careful attention needs to be paid to the
formulation of the contrasts. Also, it's best if the interpretation
gained from the signed p-values agrees with the interpretation of a
simple plot of the data.

To summarize, if we are testing for simple group differences, the F-
test only provides a single p-value, which indicates if there is 

Re: [Freesurfer] LME univariate data

2018-04-12 Thread lanbo Wang
Dear Kersten,

Thanks for reply. I have new question.
When I set model use total_i_vol_stats = lme_fit_FS(X,[1 2],Y(:,2),ni)
and total_i_vol_stats = lme_fit_FS(X,[1],Y(:,2),ni).
But Bhat of two models' year have a lot different, for example, with 2 is
1.2422 without 2 is -0.5737. The direction has already changed. I feel
confuse about this. Looking for your reply.

Thanks,
Lanbo


On Wed, Mar 28, 2018 at 2:05 PM, Diers, Kersten /DZNE  wrote:

> Hi
>
> sorry for the delayed response, I was not able to reply during the last
> week.
>
> You are right that the F-test provided in the LME toolbox initially
> does not provide information about the direction of the effects.
>
> You could do the following:
>
> First, it is always useful to plot the data to get a first impression.
> However, if the statistical model also contains additional covariates,
> this plot does not completely reflect the effects as estimated by the
> model. So this may not give a complete picture.
>
> A second option is to take a look at the sign of the estimated beta
> values, which also reflect the direction of the effects. These beta
> values are stored in the output of the 'lme_fit_FS' script, e.g.
> 'total_hipp_vol_stats.Bhat' in the tutorial example. For proper
> interpretation, you'd need to relate the beta values and their
> corresponding columns of the design matrix, and also take your
> contrasts of interest into account. So this is somewhat complicated.
>
> As an alternative, the LME toolbox also provides so-called "signed p-
> values". Note that these are not p-values in the conventional sense. A
> signed p-value is the sign (-1 or +1) of the scalar product of a row of
> the contrast matrix and the vector of the estimated betas, and it can
> give information about the direction of a specific effect.
>
> These signed p-values can be accessed from the output of the 'lme_F'
> script, see e.g. the 'F_C.sgn' variable for the tutorial example.
>
> There will be as many signed p-values as there are rows in the contrast
> matrix, so each signed p-value corresponds to one row of the contrast
> matrix.
>
> The interpretation of this signed p-value depends on how the contrast
> was formulated:
>
> In a hypothetical example (different from and simpler than the tutorial
> example), suppose that one row of a contrast matrix starts like
>
> 0 1 -1 ...
>
> and the entries correspond to group1, group2, group3, ..., then a
> positive signed p-value will in this particular case indicate that the
> difference 'group2 minus group3' is greater than zero, which means that
> group2 has greater values than group3. On the other hand, a negative
> signed p-value will in this particular case indicate that the
> difference 'group2 minus group3' is less than zero, and hence group3
> must have greater values than group2.
>
> However, also consider the equally valid alternative that a row of a
> contrast matrix starts like
>
> 0 -1 1 ...
>
> and the entries again correspond to group1, group2, group3, ..., then a
> positive signed p-value will in this particular case indicate that the
> difference 'group3 minus group2' is greater than zero, which means that
> group3 has greater values than group2. On the other hand, a negative
> signed p-value will in this particular case indicate that the
> difference 'group3 minus group2' is less than zero, and hence group2
> must have greater values than group3.
>
> So the second interpretation is just the opposite as the first one.
> This illustrates that careful attention needs to be paid to the
> formulation of the contrasts. Also, it's best if the interpretation
> gained from the signed p-values agrees with the interpretation of a
> simple plot of the data.
>
> To summarize, if we are testing for simple group differences, the F-
> test only provides a single p-value, which indicates if there is at
> least one significant difference among the several groups. To get an
> idea which groups actually differ, and in which direction, one needs to
> take a closer look, for example at those effects that are reflected in
> the rows of the contrast matrix; for this, one option is to use the
> signed p-values as described above.
>
> Hope this helps,
>
> Kersten
>
> On Di, 2018-03-27 at 15:31 +0200, lanbo Wang wrote:
> > Dear Kersten,
> >
> > I have a question about LME model. After I acquired p value, could I
> > know which group is bigger?
> >
> > Thanks,
> > Lanbo
> >
> > On Fri, Mar 16, 2018 at 12:13 AM, lanbo Wang  to:drram...@gmail.com>> wrote:
> > Dear Kersten,
> >
> > Thanks a lot, it's really help. I have another question, after I got
> > results that two group have significant, then how could I get
> > direction?
> >
> > Thanks,
> > Lanbo
> >
> > On Tue, Mar 13, 2018 at 5:40 PM, Diers, Kersten /DZNE  > dzne.de> wrote:
> > Hello,
> >
> > On Di, 2018-03-13 at 21:48 +0100, lanbo Wang wrote:
> > >
> > > Dear Kersten,
> > >
> > > Thanks, 

Re: [Freesurfer] LME univariate data

2018-03-28 Thread Diers, Kersten /DZNE
Hi 

sorry for the delayed response, I was not able to reply during the last
week.

You are right that the F-test provided in the LME toolbox initially
does not provide information about the direction of the effects.

You could do the following:

First, it is always useful to plot the data to get a first impression.
However, if the statistical model also contains additional covariates,
this plot does not completely reflect the effects as estimated by the
model. So this may not give a complete picture.

A second option is to take a look at the sign of the estimated beta
values, which also reflect the direction of the effects. These beta
values are stored in the output of the 'lme_fit_FS' script, e.g.
'total_hipp_vol_stats.Bhat' in the tutorial example. For proper
interpretation, you'd need to relate the beta values and their
corresponding columns of the design matrix, and also take your
contrasts of interest into account. So this is somewhat complicated.

As an alternative, the LME toolbox also provides so-called "signed p-
values". Note that these are not p-values in the conventional sense. A
signed p-value is the sign (-1 or +1) of the scalar product of a row of
the contrast matrix and the vector of the estimated betas, and it can
give information about the direction of a specific effect.

These signed p-values can be accessed from the output of the 'lme_F'
script, see e.g. the 'F_C.sgn' variable for the tutorial example.

There will be as many signed p-values as there are rows in the contrast
matrix, so each signed p-value corresponds to one row of the contrast
matrix. 

The interpretation of this signed p-value depends on how the contrast
was formulated:

In a hypothetical example (different from and simpler than the tutorial
example), suppose that one row of a contrast matrix starts like

0 1 -1 ...

and the entries correspond to group1, group2, group3, ..., then a
positive signed p-value will in this particular case indicate that the
difference 'group2 minus group3' is greater than zero, which means that
group2 has greater values than group3. On the other hand, a negative
signed p-value will in this particular case indicate that the
difference 'group2 minus group3' is less than zero, and hence group3
must have greater values than group2.

However, also consider the equally valid alternative that a row of a
contrast matrix starts like

0 -1 1 ...

and the entries again correspond to group1, group2, group3, ..., then a
positive signed p-value will in this particular case indicate that the
difference 'group3 minus group2' is greater than zero, which means that
group3 has greater values than group2. On the other hand, a negative
signed p-value will in this particular case indicate that the
difference 'group3 minus group2' is less than zero, and hence group2
must have greater values than group3. 

So the second interpretation is just the opposite as the first one.
This illustrates that careful attention needs to be paid to the
formulation of the contrasts. Also, it's best if the interpretation
gained from the signed p-values agrees with the interpretation of a
simple plot of the data.

To summarize, if we are testing for simple group differences, the F-
test only provides a single p-value, which indicates if there is at
least one significant difference among the several groups. To get an
idea which groups actually differ, and in which direction, one needs to
take a closer look, for example at those effects that are reflected in
the rows of the contrast matrix; for this, one option is to use the
signed p-values as described above.

Hope this helps,

Kersten

On Di, 2018-03-27 at 15:31 +0200, lanbo Wang wrote:
> Dear Kersten,
> 
> I have a question about LME model. After I acquired p value, could I
> know which group is bigger?
> 
> Thanks,
> Lanbo
> 
> On Fri, Mar 16, 2018 at 12:13 AM, lanbo Wang > wrote:
> Dear Kersten,
> 
> Thanks a lot, it's really help. I have another question, after I got
> results that two group have significant, then how could I get
> direction?
> 
> Thanks,
> Lanbo
> 
> On Tue, Mar 13, 2018 at 5:40 PM, Diers, Kersten /DZNE  dzne.de> wrote:
> Hello,
> 
> On Di, 2018-03-13 at 21:48 +0100, lanbo Wang wrote:
> > 
> > Dear Kersten,
> > 
> > Thanks, I find it. And I have other questions:
> > 1. The intercepts all set as one, so in this model it doesn't
> > separate different subjects, or can say no individual subject
> > change
> > rate?
> If I understood correctly, the question is whether or not we can get
> estimates for individual slopes across time?
> 
> If so, then yes, that's possible - but I'd have to run an analysis
> myself and look up how to do it exactly - I'll get back on this.
> 
> > 
> > 2. Should we set age according to different timepoint, or just use
> > baseline age?
> It's better to use age at baseline.
> 
> One of the nice things of the LME is that it can separate the cross-
> 

Re: [Freesurfer] LME univariate data

2018-03-27 Thread lanbo Wang
Dear Kersten,

I have a question about LME model. After I acquired p value, could I know
which group is bigger?

Thanks,
Lanbo

On Fri, Mar 16, 2018 at 12:13 AM, lanbo Wang  wrote:

> Dear Kersten,
>
> Thanks a lot, it's really help. I have another question, after I got
> results that two group have significant, then how could I get direction?
>
> Thanks,
> Lanbo
>
> On Tue, Mar 13, 2018 at 5:40 PM, Diers, Kersten /DZNE <
> kersten.di...@dzne.de> wrote:
>
>> Hello,
>>
>> On Di, 2018-03-13 at 21:48 +0100, lanbo Wang wrote:
>> > Dear Kersten,
>> >
>> > Thanks, I find it. And I have other questions:
>> > 1. The intercepts all set as one, so in this model it doesn't
>> > separate different subjects, or can say no individual subject change
>> > rate?
>>
>> If I understood correctly, the question is whether or not we can get
>> estimates for individual slopes across time?
>>
>> If so, then yes, that's possible - but I'd have to run an analysis
>> myself and look up how to do it exactly - I'll get back on this.
>>
>> > 2. Should we set age according to different timepoint, or just use
>> > baseline age?
>>
>> It's better to use age at baseline.
>>
>> One of the nice things of the LME is that it can separate the cross-
>> sectional effect of age (at baseline) and the longitudinal effect of
>> aging (=effect of time). So the aging effect is already incorporated
>> within the 'time since baseline' variable, which of course should also
>> be present in the model.
>>
>> Since it is difficult to estimate and interpret effects that are very
>> redundant (such as time vs age at each timepoint), it's better to just
>> use age at baseline for the other regressor.
>>
>> Best regards,
>>
>> Kersten
>>
>> > Thanks,
>> > Lanbo
>> >
>> > On Tue, Mar 13, 2018 at 3:34 PM, Diers, Kersten /DZNE > > dzne.de> wrote:
>> > Hello Lanbo,
>> >
>> > the univariate example data can actually be downloaded from the LME
>> > tutorial website:
>> >
>> > Search for: "An optional sample dataset which can be used to become
>> > familiar with the LME Matlab tools can be found here". The linked
>> > tar.gz archive contains two folders, one for the univariate and one
>> > for
>> > the mass-univariate example data.
>> >
>> > Best regards,
>> >
>> > Kersten
>> >
>> > On Di, 2018-03-13 at 13:38 +0100, lanbo Wang wrote:
>> > >
>> > > Dear Experts,
>> > >
>> > > Hi,
>> > > There is no example detail on website of LME tutorial. I have some
>> > > question about it.
>> > > Could you send me the table of ADNI univariate example data?
>> > >
>> > >
>> > > Thanks,
>> > > Lanbo
>> > ___
>> > Freesurfer mailing list
>> > Freesurfer@nmr.mgh.harvard.edu
>> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>> >
>> >
>> > The information in this e-mail is intended only for the person to
>> > whom it is
>> > addressed. If you believe this e-mail was sent to you in error and
>> > the e-mail
>> > contains patient information, please contact the Partners Compliance
>> > HelpLine at
>> > http://www.partners.org/complianceline . If the e-mail was sent to
>> > you in error
>> > but does not contain patient information, please contact the sender
>> > and properly
>> > dispose of the e-mail.
>> >
>> >
>>
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>
>
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME univariate data

2018-03-15 Thread lanbo Wang
Dear Kersten,

Thanks a lot, it's really help. I have another question, after I got
results that two group have significant, then how could I get direction?

Thanks,
Lanbo

On Tue, Mar 13, 2018 at 5:40 PM, Diers, Kersten /DZNE  wrote:

> Hello,
>
> On Di, 2018-03-13 at 21:48 +0100, lanbo Wang wrote:
> > Dear Kersten,
> >
> > Thanks, I find it. And I have other questions:
> > 1. The intercepts all set as one, so in this model it doesn't
> > separate different subjects, or can say no individual subject change
> > rate?
>
> If I understood correctly, the question is whether or not we can get
> estimates for individual slopes across time?
>
> If so, then yes, that's possible - but I'd have to run an analysis
> myself and look up how to do it exactly - I'll get back on this.
>
> > 2. Should we set age according to different timepoint, or just use
> > baseline age?
>
> It's better to use age at baseline.
>
> One of the nice things of the LME is that it can separate the cross-
> sectional effect of age (at baseline) and the longitudinal effect of
> aging (=effect of time). So the aging effect is already incorporated
> within the 'time since baseline' variable, which of course should also
> be present in the model.
>
> Since it is difficult to estimate and interpret effects that are very
> redundant (such as time vs age at each timepoint), it's better to just
> use age at baseline for the other regressor.
>
> Best regards,
>
> Kersten
>
> > Thanks,
> > Lanbo
> >
> > On Tue, Mar 13, 2018 at 3:34 PM, Diers, Kersten /DZNE  > dzne.de> wrote:
> > Hello Lanbo,
> >
> > the univariate example data can actually be downloaded from the LME
> > tutorial website:
> >
> > Search for: "An optional sample dataset which can be used to become
> > familiar with the LME Matlab tools can be found here". The linked
> > tar.gz archive contains two folders, one for the univariate and one
> > for
> > the mass-univariate example data.
> >
> > Best regards,
> >
> > Kersten
> >
> > On Di, 2018-03-13 at 13:38 +0100, lanbo Wang wrote:
> > >
> > > Dear Experts,
> > >
> > > Hi,
> > > There is no example detail on website of LME tutorial. I have some
> > > question about it.
> > > Could you send me the table of ADNI univariate example data?
> > >
> > >
> > > Thanks,
> > > Lanbo
> > ___
> > Freesurfer mailing list
> > Freesurfer@nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> >
> >
> > The information in this e-mail is intended only for the person to
> > whom it is
> > addressed. If you believe this e-mail was sent to you in error and
> > the e-mail
> > contains patient information, please contact the Partners Compliance
> > HelpLine at
> > http://www.partners.org/complianceline . If the e-mail was sent to
> > you in error
> > but does not contain patient information, please contact the sender
> > and properly
> > dispose of the e-mail.
> >
> >
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME univariate data

2018-03-13 Thread Diers, Kersten /DZNE
Hello,

On Di, 2018-03-13 at 21:48 +0100, lanbo Wang wrote:
> Dear Kersten,
> 
> Thanks, I find it. And I have other questions:
> 1. The intercepts all set as one, so in this model it doesn't
> separate different subjects, or can say no individual subject change
> rate?

If I understood correctly, the question is whether or not we can get
estimates for individual slopes across time? 

If so, then yes, that's possible - but I'd have to run an analysis
myself and look up how to do it exactly - I'll get back on this.

> 2. Should we set age according to different timepoint, or just use
> baseline age?

It's better to use age at baseline. 

One of the nice things of the LME is that it can separate the cross-
sectional effect of age (at baseline) and the longitudinal effect of
aging (=effect of time). So the aging effect is already incorporated
within the 'time since baseline' variable, which of course should also
be present in the model. 

Since it is difficult to estimate and interpret effects that are very
redundant (such as time vs age at each timepoint), it's better to just
use age at baseline for the other regressor.

Best regards,

Kersten

> Thanks,
> Lanbo
> 
> On Tue, Mar 13, 2018 at 3:34 PM, Diers, Kersten /DZNE  dzne.de> wrote:
> Hello Lanbo,
> 
> the univariate example data can actually be downloaded from the LME
> tutorial website:
> 
> Search for: "An optional sample dataset which can be used to become
> familiar with the LME Matlab tools can be found here". The linked
> tar.gz archive contains two folders, one for the univariate and one
> for
> the mass-univariate example data.
> 
> Best regards,
> 
> Kersten
> 
> On Di, 2018-03-13 at 13:38 +0100, lanbo Wang wrote:
> > 
> > Dear Experts,
> > 
> > Hi,
> > There is no example detail on website of LME tutorial. I have some
> > question about it.
> > Could you send me the table of ADNI univariate example data?
> > 
> > 
> > Thanks,
> > Lanbo
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> 
> The information in this e-mail is intended only for the person to
> whom it is
> addressed. If you believe this e-mail was sent to you in error and
> the e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to
> you in error
> but does not contain patient information, please contact the sender
> and properly
> dispose of the e-mail.
> 
> 

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] LME univariate data

2018-03-13 Thread lanbo Wang
Dear Kersten,

Thanks, I find it. And I have other questions:
1. The intercepts all set as one, so in this model it doesn't separate
different subjects, or can say no individual subject change rate?
2. Should we set age according to different timepoint, or just use baseline
age?

Thanks,
Lanbo

On Tue, Mar 13, 2018 at 3:34 PM, Diers, Kersten /DZNE  wrote:

> Hello Lanbo,
>
> the univariate example data can actually be downloaded from the LME
> tutorial website:
>
> Search for: "An optional sample dataset which can be used to become
> familiar with the LME Matlab tools can be found here". The linked
> tar.gz archive contains two folders, one for the univariate and one for
> the mass-univariate example data.
>
> Best regards,
>
> Kersten
>
> On Di, 2018-03-13 at 13:38 +0100, lanbo Wang wrote:
> > Dear Experts,
> >
> > Hi,
> > There is no example detail on website of LME tutorial. I have some
> > question about it.
> > Could you send me the table of ADNI univariate example data?
> >
> >
> > Thanks,
> > Lanbo
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME univariate data

2018-03-13 Thread Diers, Kersten /DZNE
Hello Lanbo,

the univariate example data can actually be downloaded from the LME
tutorial website:

Search for: "An optional sample dataset which can be used to become
familiar with the LME Matlab tools can be found here". The linked
tar.gz archive contains two folders, one for the univariate and one for
the mass-univariate example data.

Best regards,

Kersten

On Di, 2018-03-13 at 13:38 +0100, lanbo Wang wrote:
> Dear Experts,
> 
> Hi,
> There is no example detail on website of LME tutorial. I have some
> question about it.
> Could you send me the table of ADNI univariate example data?
> 
> 
> Thanks,
> Lanbo

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.



[Freesurfer] LME univariate data

2018-03-13 Thread lanbo Wang
Dear Experts,

Hi,
There is no example detail on website of LME tutorial. I have some question
about it.
Could you send me the table of ADNI univariate example data?


Thanks,
Lanbo
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME

2018-01-12 Thread Tefera, Getaneh B
Kersten

Thank you so much.

With regards

Getaneh

-Original Message-
From: freesurfer-boun...@nmr.mgh.harvard.edu 
[mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Diers, Kersten 
/DZNE
Sent: Friday, January 12, 2018 9:50 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

thanks for the additional information.

I suspect that one source of confusion was that we have to distinguish the 
univariate and the mass-univariate processing stream in the LME toolbox. 

The univariate stream is about a single measure like left or right or bilateral 
hippocampal volume, whereas the mass-univariate stream does statistical 
modeling and testing for all vertices in a hemisphere, for example to evaluate 
cortical thickness.

For a large part of my previous replies I was assuming that we are talking 
about the univariate stream, where we need to use the 'lme_fit_FS' script. In 
contrast, the 'lme_mass_fit_Rgw' script, among others, is used for estimation 
in the mass-univariate stream.

In that sense, it is not surprising to get error messages when using the 
'lme_fit_FS' script with mass-univariate vertex data as in your example.

The bad news is that power analysis is only implemented for the univariate 
stream, but not the mass-univariate stream. This is because mass-univariate 
processing returns thousands of different estimates for phisq and Dhat, among 
others, one for each vertex in a hemisphere. We can get them from the data 
structure returned by 'lme_mass_fit_Rgw', but they are simply too many to 
submit to the power analysis. 

In that sense, I currently see no viable way for power analysis for cortical 
thickness data within the LME toolbox unless we can reduce it to using 
estimates of a single (as opposed to multi-vertex) effect and its variabilty.

Likewise, it is not surprising that estimates for Dhat and phisqhat are 
different for e.g. the left and right hippocampus. One might speculate, though, 
that they should be somewhat similar, and I would be somewhat suprised if 
sample size calculations based on them result in very different sample size 
estimates.

I have one more remark about the lme_plannedSampleSize script: I would only 
recommend using it prospectively. As far as I can see it is not intended nor 
can it be meaningfully used retrospectively, i.e. for assessing the properties 
of a study that has already been conducted. 

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Cc: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Subject: Re: [Freesurfer] LME
Date: Thu, 11 Jan 2018 21:09:21 +0100

Hi Kersten,

I am sorry I did not make the question more specific.

I have three groups. I want see the power analysis by checking the sample size 
calculation for the cortical thickness analysis .

[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


my question is how can I get Dhat ( Estimated random effects covariance matrix) 
and phisqhat (Estimated intra-subject
variability) to calculate the sample size of the pairs  .

Based on your suggestion to get Dhat and phisqhat I have to run "
lme_fit_FS(X,[1,2],y ,ni)"

When I run

lme_fit_FS(X,[1,2],y ,ni), where  Y is obtained from the following

[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh'),  I get error.

Which function with what argument is good to use to find Dhat and phisqhat?

Are these values the same for left and right cortical thickness data?

I am  sorry for the inconvenience .


with regards

Getaneh



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mg h.ha 
"rvard.edu> on behalf of Diers, Kersten /DZNE <Kersten.Diers@dzne.
de>
Sent: Thursday, January 11, 2018 3:50 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi,

I am not entirely sure that I understand the goal of this particular analysis, 
so I don't have any suggestions at the moment.

Maybe you could give some more detail, if this is still an issue.

Best regards,

Kersten

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Wed, 10 Jan 2018 17:58:58 +0100

Dear Kersten,

Thank you so much.

When I run the procedure with left and right cortical thickness data I  get 
different phisqhat values
Phisqhat:0.2530 for the left and
Phisqhat:0.0903 for the right

The Dhat matrix is also different.

Is that Ok?

If so , shall  I consider two sample sizes  for the left and right?

Re: [Freesurfer] LME

2018-01-12 Thread Diers, Kersten /DZNE
Hi Getaneh,

thanks for the additional information.

I suspect that one source of confusion was that we have to distinguish
the univariate and the mass-univariate processing stream in the LME
toolbox. 

The univariate stream is about a single measure like left or right or
bilateral hippocampal volume, whereas the mass-univariate stream does
statistical modeling and testing for all vertices in a hemisphere, for
example to evaluate cortical thickness.

For a large part of my previous replies I was assuming that we are
talking about the univariate stream, where we need to use the
'lme_fit_FS' script. In contrast, the 'lme_mass_fit_Rgw' script, among
others, is used for estimation in the mass-univariate stream.

In that sense, it is not surprising to get error messages when using
the 'lme_fit_FS' script with mass-univariate vertex data as in your
example.

The bad news is that power analysis is only implemented for the
univariate stream, but not the mass-univariate stream. This is because
mass-univariate processing returns thousands of different estimates for
phisq and Dhat, among others, one for each vertex in a hemisphere. We
can get them from the data structure returned by 'lme_mass_fit_Rgw',
but they are simply too many to submit to the power analysis. 

In that sense, I currently see no viable way for power analysis for
cortical thickness data within the LME toolbox unless we can reduce it
to using estimates of a single (as opposed to multi-vertex) effect and
its variabilty.

Likewise, it is not surprising that estimates for Dhat and phisqhat are
different for e.g. the left and right hippocampus. One might speculate,
though, that they should be somewhat similar, and I would be somewhat
suprised if sample size calculations based on them result in very
different sample size estimates.

I have one more remark about the lme_plannedSampleSize script: I would
only recommend using it prospectively. As far as I can see it is not
intended nor can it be meaningfully used retrospectively, i.e. for
assessing the properties of a study that has already been conducted. 

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Cc: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Subject: Re: [Freesurfer] LME
Date: Thu, 11 Jan 2018 21:09:21 +0100

Hi Kersten,

I am sorry I did not make the question more specific.

I have three groups. I want see the power analysis by checking the
sample size calculation for the cortical thickness analysis .

[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


my question is how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject
variability) to calculate the sample size of the pairs  .

Based on your suggestion to get Dhat and phisqhat I have to run "
lme_fit_FS(X,[1,2],y ,ni)"

When I run

lme_fit_FS(X,[1,2],y ,ni), where  Y is obtained from the following

[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh'),  I get error.

Which function with what argument is good to use to find Dhat and
phisqhat?

Are these values the same for left and right cortical thickness data?

I am  sorry for the inconvenience .


with regards

Getaneh



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mg
h.ha "rvard.edu> on behalf of Diers, Kersten /DZNE <Kersten.Diers@dzne.
de>
Sent: Thursday, January 11, 2018 3:50 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi,

I am not entirely sure that I understand the goal of this particular
analysis, so I don't have any suggestions at the moment.

Maybe you could give some more detail, if this is still an issue.

Best regards,

Kersten

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Wed, 10 Jan 2018 17:58:58 +0100

Dear Kersten,

Thank you so much.

When I run the procedure with left and right cortical thickness data
I  get different phisqhat values
Phisqhat:0.2530 for the left and
Phisqhat:0.0903 for the right

The Dhat matrix is also different.

Is that Ok?

If so , shall  I consider two sample sizes  for the left and right?


With regards

Getaneh



-Original Message-
From: freesurfer-boun...@nmr.mgh.harvard.edu [mailto:freesurfer-bounces
@nmr.mgh.harvard.edu] On Behalf Of Diers, Kersten /DZNE
Sent: Wednesday, January 10, 2018 7:10 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

the estimates for D and phisq for a given 

Re: [Freesurfer] LME

2018-01-11 Thread Tefera, Getaneh B
Hi Kersten,

I am sorry I did not make the question more specific.

I have three groups. I want see the power analysis by checking the sample size 
calculation for the cortical thickness analysis .

[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr_pr)


my question is how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject
variability) to calculate the sample size of the pairs  .

Based on your suggestion to get Dhat and phisqhat I have to run " 
lme_fit_FS(X,[1,2],y ,ni)"

When I run 

lme_fit_FS(X,[1,2],y ,ni), where  Y is obtained from the following

[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh'),  I get error. 

Which function with what argument is good to use to find Dhat and phisqhat?

Are these values the same for left and right cortical thickness data?

I am  sorry for the inconvenience .


with regards

Getaneh



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mgh.ha 
"rvard.edu> on behalf of Diers, Kersten /DZNE <kersten.di...@dzne.de>
Sent: Thursday, January 11, 2018 3:50 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi,

I am not entirely sure that I understand the goal of this particular
analysis, so I don't have any suggestions at the moment.

Maybe you could give some more detail, if this is still an issue.

Best regards,

Kersten

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Wed, 10 Jan 2018 17:58:58 +0100

Dear Kersten,

Thank you so much.

When I run the procedure with left and right cortical thickness data
I  get different phisqhat values
Phisqhat:0.2530 for the left and
Phisqhat:0.0903 for the right

The Dhat matrix is also different.

Is that Ok?

If so , shall  I consider two sample sizes  for the left and right?


With regards

Getaneh



-Original Message-
From: freesurfer-boun...@nmr.mgh.harvard.edu [mailto:freesurfer-bounces
@nmr.mgh.harvard.edu] On Behalf Of Diers, Kersten /DZNE
Sent: Wednesday, January 10, 2018 7:10 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

the estimates for D and phisq for a given analysis are contained within
the data structure that is returned by the lme_fit_FS procedure.

I.e. for the tutorial data, the command was:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Dhat and phisqhat are fields of the 'total_hipp_vol_stats' structure,
and can be accessed by typing 'total_hipp_vol_stats.Dhat' and
'total_hipp_vol_stats.phisqhat', respectively.

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Tue, 9 Jan 2018 23:02:08 +0100

Hi Kersten.

Thank you very much .

I am not planning a new design for sample size calculation.

Can you please help me how to find those values?

Thank you

Getaneh



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mg
 h.harvard.edu> on behalf of Diers, Kersten /DZNE <Kersten.Diers@dzne.d
e
>
>
Sent: Tuesday, January 9, 2018 5:56 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

please find my responses below.

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] LME
Date: Mon, 8 Jan 2018 22:54:49 +0100

Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from
the base line.

Based on the LME tutorial  and the questions and answers from
Freesurfer support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ …

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0 The slope
difference between  g0 and g2: 0 0 0 0 0 1 The slope difference
between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope
difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0
1 0 0; 0 0 -1 0 1] zeros(3,6)]

This is a correct matrix, but only for the particular design given in
the tutorial, i.e. 4 groups and several covariates. Also, it is not
strictly speaking a pairwise test, but will indicate if there is *any*
difference between the slopes of

Re: [Freesurfer] LME

2018-01-11 Thread Diers, Kersten /DZNE
Hi,

I am not entirely sure that I understand the goal of this particular
analysis, so I don't have any suggestions at the moment. 

Maybe you could give some more detail, if this is still an issue.

Best regards,

Kersten

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Wed, 10 Jan 2018 17:58:58 +0100

Dear Kersten,

Thank you so much.

When I run the procedure with left and right cortical thickness data
I  get different phisqhat values
Phisqhat:0.2530 for the left and
Phisqhat:0.0903 for the right

The Dhat matrix is also different.

Is that Ok?

If so , shall  I consider two sample sizes  for the left and right?


With regards

Getaneh



-Original Message-
From: freesurfer-boun...@nmr.mgh.harvard.edu [mailto:freesurfer-bounces
@nmr.mgh.harvard.edu] On Behalf Of Diers, Kersten /DZNE
Sent: Wednesday, January 10, 2018 7:10 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

the estimates for D and phisq for a given analysis are contained within
the data structure that is returned by the lme_fit_FS procedure.

I.e. for the tutorial data, the command was:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Dhat and phisqhat are fields of the 'total_hipp_vol_stats' structure,
and can be accessed by typing 'total_hipp_vol_stats.Dhat' and
'total_hipp_vol_stats.phisqhat', respectively.

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Tue, 9 Jan 2018 23:02:08 +0100

Hi Kersten.

Thank you very much .

I am not planning a new design for sample size calculation.

Can you please help me how to find those values?

Thank you

Getaneh 



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mg
 h.harvard.edu> on behalf of Diers, Kersten /DZNE <Kersten.Diers@dzne.d
e
> 
> 
Sent: Tuesday, January 9, 2018 5:56 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

please find my responses below.

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] LME
Date: Mon, 8 Jan 2018 22:54:49 +0100

Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from
the base line.

Based on the LME tutorial  and the questions and answers from
Freesurfer support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ …

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0 The slope
difference between  g0 and g2: 0 0 0 0 0 1 The slope difference
between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope
difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0
1 0 0; 0 0 -1 0 1] zeros(3,6)]

This is a correct matrix, but only for the particular design given in
the tutorial, i.e. 4 groups and several covariates. Also, it is not
strictly speaking a pairwise test, but will indicate if there is *any*
difference between the slopes of the groups (i.e. it will give only one
F- and p-value).
If you specifically want to test differences between particular pairs,
use contrast matrices with just a single row.


2)  Is it necessary to combine contrast matrix of the pair
difference the same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]

It makes sense to look at the overall effect prior to looking at
pairwise differences. If you don't have any additional covariates, that
matrix is OK for looking the overall effect. Otherwise, add as many
columns of zeros as you have covariates, similar to the tutorial.

3)  How can we interpret the  result for this contrast matrix?

This is an F-test to detect if there is any difference between the
slopes of the groups.


4)  How can I obtain B1, B2, … ?

Consider the following command from the tutorial:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Then B1 and B2 will be the first two entries of
total_hipp_vol_stats.Bhat


[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


5)  For sample size calculation how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject 

Re: [Freesurfer] LME

2018-01-10 Thread Tefera, Getaneh B
Dear Kersten,

Thank you so much.

When I run the procedure with left and right cortical thickness data I  get 
different phisqhat values
Phisqhat:0.2530 for the left and
Phisqhat:0.0903 for the right

The Dhat matrix is also different.

Is that Ok?

If so , shall  I consider two sample sizes  for the left and right?

With regards

Getaneh



-Original Message-
From: freesurfer-boun...@nmr.mgh.harvard.edu 
[mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Diers, Kersten 
/DZNE
Sent: Wednesday, January 10, 2018 7:10 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

the estimates for D and phisq for a given analysis are contained within the 
data structure that is returned by the lme_fit_FS procedure.

I.e. for the tutorial data, the command was:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Dhat and phisqhat are fields of the 'total_hipp_vol_stats' structure, and can 
be accessed by typing 'total_hipp_vol_stats.Dhat' and 
'total_hipp_vol_stats.phisqhat', respectively.

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Tue, 9 Jan 2018 23:02:08 +0100

Hi Kersten.

Thank you very much .

I am not planning a new design for sample size calculation.

Can you please help me how to find those values?

Thank you

Getaneh 



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mg 
h.harvard.edu> on behalf of Diers, Kersten /DZNE <kersten.di...@dzne.de
>
Sent: Tuesday, January 9, 2018 5:56 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

please find my responses below.

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] LME
Date: Mon, 8 Jan 2018 22:54:49 +0100

Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from the base 
line.

Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ …

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0 The slope difference 
between  g0 and g2: 0 0 0 0 0 1 The slope difference between  g1 and g2: 0 0 0 
-1 0 1


1)  Is this contrast matrix correct to observe pairwise slope difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0
1 0 0; 0 0 -1 0 1] zeros(3,6)]

This is a correct matrix, but only for the particular design given in the 
tutorial, i.e. 4 groups and several covariates. Also, it is not strictly 
speaking a pairwise test, but will indicate if there is *any* difference 
between the slopes of the groups (i.e. it will give only one
F- and p-value).
If you specifically want to test differences between particular pairs, use 
contrast matrices with just a single row.


2)  Is it necessary to combine contrast matrix of the pair difference the 
same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]

It makes sense to look at the overall effect prior to looking at pairwise 
differences. If you don't have any additional covariates, that matrix is OK for 
looking the overall effect. Otherwise, add as many columns of zeros as you have 
covariates, similar to the tutorial.

3)  How can we interpret the  result for this contrast matrix?

This is an F-test to detect if there is any difference between the slopes of 
the groups.


4)  How can I obtain B1, B2, … ?

Consider the following command from the tutorial:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Then B1 and B2 will be the first two entries of total_hipp_vol_stats.Bhat


[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


5)  For sample size calculation how can I get Dhat ( Estimated random 
effects covariance matrix) and phisqhat (Estimated intra-subject variability)?

If you are planning a new design, these estimates should be based on prior 
knowledge and can be derived e.g. from a pilot study or from the literature.

Best regards,

Kersten



With regards

Getaneh




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harva
rd.edu_mailman_listinfo_freesurfer=DwIGaQ=6vgNTiRn9_pqCD9hKx9JgXN1V
apJQ8JVoF8oWH1AgfQ=f2w_aQllkjZisjakf5SS_8h7m7gQVFtFYc

Re: [Freesurfer] LME

2018-01-10 Thread Diers, Kersten /DZNE
Hi Getaneh,

the estimates for D and phisq for a given analysis are contained within
the data structure that is returned by the lme_fit_FS procedure.

I.e. for the tutorial data, the command was:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Dhat and phisqhat are fields of the 'total_hipp_vol_stats' structure,
and can be accessed by typing 'total_hipp_vol_stats.Dhat' and
'total_hipp_vol_stats.phisqhat', respectively.

Best regards,

Kersten


-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] LME
Date: Tue, 9 Jan 2018 23:02:08 +0100

Hi Kersten.

Thank you very much .

I am not planning a new design for sample size calculation.

Can you please help me how to find those values?

Thank you

Getaneh 



From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mg
h.harvard.edu> on behalf of Diers, Kersten /DZNE <kersten.di...@dzne.de
>
Sent: Tuesday, January 9, 2018 5:56 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

please find my responses below.

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] LME
Date: Mon, 8 Jan 2018 22:54:49 +0100

Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from
the base line.

Based on the LME tutorial  and the questions and answers from
Freesurfer support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ …

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0
The slope difference between  g0 and g2: 0 0 0 0 0 1
The slope difference between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope
difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0
1 0 0; 0 0 -1 0 1] zeros(3,6)]

This is a correct matrix, but only for the particular design given in
the tutorial, i.e. 4 groups and several covariates. Also, it is not
strictly speaking a pairwise test, but will indicate if there is *any*
difference between the slopes of the groups (i.e. it will give only one
F- and p-value).
If you specifically want to test differences between particular pairs,
use contrast matrices with just a single row.


2)  Is it necessary to combine contrast matrix of the pair
difference the same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]

It makes sense to look at the overall effect prior to looking at
pairwise differences. If you don't have any additional covariates, that
matrix is OK for looking the overall effect. Otherwise, add as many
columns of zeros as you have covariates, similar to the tutorial.

3)  How can we interpret the  result for this contrast matrix?

This is an F-test to detect if there is any difference between the
slopes of the groups.


4)  How can I obtain B1, B2, … ?

Consider the following command from the tutorial:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Then B1 and B2 will be the first two entries of
total_hipp_vol_stats.Bhat


[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


5)  For sample size calculation how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject
variability)?

If you are planning a new design, these estimates should be based on
prior knowledge and can be derived e.g. from a pilot study or from the
literature.

Best regards,

Kersten



With regards

Getaneh




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harva
rd.edu_mailman_listinfo_freesurfer=DwIGaQ=6vgNTiRn9_pqCD9hKx9JgXN1V
apJQ8JVoF8oWH1AgfQ=f2w_aQllkjZisjakf5SS_8h7m7gQVFtFYcFC7K0Nk8k=w3Go
ND77ORaREflQR6B1sxt8pIPGPzd8Oh_hzfJ_rhk=7GFfEuDrrPYWE-
NE_mVYzsQUEvfZizwe853OSP2n_Zo=


The information in this e-mail is intended only for the person to whom
it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_co
mplianceline=DwIGaQ=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ=f
2w_aQllkjZisjakf5SS_8h7m7gQVFtFYcFC7K0Nk8k=w3GoND77ORaREflQR6B1sxt8pI
PGPzd8Oh_hzfJ_rhk=_JumR_-uS8QiP3xZfqqQ73pib0Pi-_MI1tUhsm2z5bA=  .
If the e-mail was s

Re: [Freesurfer] LME

2018-01-09 Thread Tefera, Getaneh B
Hi Kersten.

Thank you very much .

I am not planning a new design for sample size calculation.

Can you please help me how to find those values?

Thank you

Getaneh 



From: freesurfer-boun...@nmr.mgh.harvard.edu 
<freesurfer-boun...@nmr.mgh.harvard.edu> on behalf of Diers, Kersten /DZNE 
<kersten.di...@dzne.de>
Sent: Tuesday, January 9, 2018 5:56 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] LME

Hi Getaneh,

please find my responses below.

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] LME
Date: Mon, 8 Jan 2018 22:54:49 +0100

Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from
the base line.

Based on the LME tutorial  and the questions and answers from
Freesurfer support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ …

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0
The slope difference between  g0 and g2: 0 0 0 0 0 1
The slope difference between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope
difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0
1 0 0; 0 0 -1 0 1] zeros(3,6)]

This is a correct matrix, but only for the particular design given in
the tutorial, i.e. 4 groups and several covariates. Also, it is not
strictly speaking a pairwise test, but will indicate if there is *any*
difference between the slopes of the groups (i.e. it will give only one
F- and p-value).
If you specifically want to test differences between particular pairs,
use contrast matrices with just a single row.


2)  Is it necessary to combine contrast matrix of the pair
difference the same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]

It makes sense to look at the overall effect prior to looking at
pairwise differences. If you don't have any additional covariates, that
matrix is OK for looking the overall effect. Otherwise, add as many
columns of zeros as you have covariates, similar to the tutorial.

3)  How can we interpret the  result for this contrast matrix?

This is an F-test to detect if there is any difference between the
slopes of the groups.


4)  How can I obtain B1, B2, … ?

Consider the following command from the tutorial:

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Then B1 and B2 will be the first two entries of total_hipp_vol_stats.Bhat


[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


5)  For sample size calculation how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject
variability)?

If you are planning a new design, these estimates should be based on
prior knowledge and can be derived e.g. from a pilot study or from the
literature.

Best regards,

Kersten



With regards

Getaneh




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.edu_mailman_listinfo_freesurfer=DwIGaQ=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ=f2w_aQllkjZisjakf5SS_8h7m7gQVFtFYcFC7K0Nk8k=w3GoND77ORaREflQR6B1sxt8pIPGPzd8Oh_hzfJ_rhk=7GFfEuDrrPYWE-NE_mVYzsQUEvfZizwe853OSP2n_Zo=


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complianceline=DwIGaQ=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ=f2w_aQllkjZisjakf5SS_8h7m7gQVFtFYcFC7K0Nk8k=w3GoND77ORaREflQR6B1sxt8pIPGPzd8Oh_hzfJ_rhk=_JumR_-uS8QiP3xZfqqQ73pib0Pi-_MI1tUhsm2z5bA=
  . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.



Re: [Freesurfer] LME

2018-01-09 Thread Diers, Kersten /DZNE
Hi Getaneh,

please find my responses below.

-Original Message-
From: "Tefera, Getaneh B" <getaneh.b.tef...@uth.tmc.edu>
Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] LME
Date: Mon, 8 Jan 2018 22:54:49 +0100

Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from
the base line.

Based on the LME tutorial  and the questions and answers from
Freesurfer support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ …

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0
The slope difference between  g0 and g2: 0 0 0 0 0 1
The slope difference between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope
difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0
1 0 0; 0 0 -1 0 1] zeros(3,6)]

This is a correct matrix, but only for the particular design given in
the tutorial, i.e. 4 groups and several covariates. Also, it is not
strictly speaking a pairwise test, but will indicate if there is *any*
difference between the slopes of the groups (i.e. it will give only one
F- and p-value). 
If you specifically want to test differences between particular pairs,
use contrast matrices with just a single row.


2)  Is it necessary to combine contrast matrix of the pair
difference the same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]

It makes sense to look at the overall effect prior to looking at
pairwise differences. If you don't have any additional covariates, that
matrix is OK for looking the overall effect. Otherwise, add as many
columns of zeros as you have covariates, similar to the tutorial.

3)  How can we interpret the  result for this contrast matrix?

This is an F-test to detect if there is any difference between the
slopes of the groups.


4)  How can I obtain B1, B2, … ?

Consider the following command from the tutorial: 

total_hipp_vol_stats = lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);

Then B1 and B2 will be the first two entries of total_hipp_vol_stats.Bhat


[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr
_pr)


5)  For sample size calculation how can I get Dhat ( Estimated
random effects covariance matrix) and phisqhat (Estimated intra-subject 
variability)?

If you are planning a new design, these estimates should be based on
prior knowledge and can be derived e.g. from a pilot study or from the
literature.

Best regards,

Kersten



With regards

Getaneh




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME

2018-01-08 Thread Tefera, Getaneh B
Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from the base 
line.

Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ ...

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0
The slope difference between  g0 and g2: 0 0 0 0 0 1
The slope difference between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0 1 0 0; 0 
0 -1 0 1] zeros(3,6)]


2)  Is it necessary to combine contrast matrix of the pair difference the 
same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]


3)  How can we interpret the  result for this contrast matrix?


4)  How can I obtain B1, B2, ... ?

[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr_pr)


5)  For sample size calculation how can I get Dhat ( Estimated random 
effects covariance matrix) and phisqhat (Estimated intra-subject variability)?


With regards

Getaneh




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME

2018-01-08 Thread Tefera, Getaneh B
Dear Freesurfer experts,


I have three groups g0, g1, and g2.

I am trying to use  LME model  with random effects y-int and time from the base 
line.

Based on the LME tutorial  and the questions and answers from Freesurfer 
support list:

Y=B1+B2*t+B3*g1+B4*g1*t+B5*g2+B6*g2*t+ ...

The slope of g0 : 0 1 0 0 0 0
The slope of g1: 0 1 0 1 0  0
The slope of g2: 0 1 0 0 0 1

The slope difference between  g0 and g1: 0 0 0 1 0 0
The slope difference between  g0 and g2: 0 0 0 0 0 1
The slope difference between  g1 and g2: 0 0 0 -1 0 1


1)  Is this contrast matrix correct to observe pairwise slope difference?

In the tutorial the contrast matrix   C = [zeros(3,3) [1 0 0 0 0; -1 0 1 0 0; 0 
0 -1 0 1] zeros(3,6)]


2)  Is it necessary to combine contrast matrix of the pair difference the 
same as the tutorial?

If so, my contrast matrix can be  C=[0 0 0 1 0 0; 0 0 0 -1 0 1]


3)  How can we interpret the  result for this contrast matrix?


4)  How can I obtain B1, B2, ... ?

[sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,...
 dr,pw,alpha,gr_pr)


5)  For sample size calculation how can I get Dhat ( Estimated random 
effects covariance matrix) and phisqhat (Estimated intra-subject variability)?


With regards

Getaneh




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME model and contrast

2017-09-08 Thread Diers, Kersten /DZNE
Seems fine to me.

As a side-note, you may want to consider centering bslBMI and other continuous 
predictors (other than time), and time should be time_from_baseline.

Best, 

Kersten


From: freesurfer-boun...@nmr.mgh.harvard.edu 
[freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Donatas Sederevicius 
[donatas.sederevic...@psykologi.uio.no]
Sent: Thursday, September 07, 2017 12:19 PM
To: freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] LME model and contrast

Dear freesurfer team,

I’m trying to use freesurfer LME tools to check whether baseline BMI scores 
(BMI scores at the first timepoint) have a statistically significant 
effect/impact on longitudinal thickness changes accounting for baseline age and 
gender. The model I’m thinking of is:

Y_ij = b0 + b1 * t_ij + b2 * bslBMI_i + b3 * bslBMI_i * t_ij + b4 * gender_i + 
b5 * bslAge_i

and the contrast  CM.M = [0 0 0 1 0 0]. Is this a correct way of doing it or 
did I misinterpret something?

Thank you.
-Donatas


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


[Freesurfer] LME model and contrast

2017-09-07 Thread Donatas Sederevicius
Dear freesurfer team,

I’m trying to use freesurfer LME tools to check whether baseline BMI scores 
(BMI scores at the first timepoint) have a statistically significant 
effect/impact on longitudinal thickness changes accounting for baseline age and 
gender. The model I’m thinking of is:

Y_ij = b0 + b1 * t_ij + b2 * bslBMI_i + b3 * bslBMI_i * t_ij + b4 * gender_i + 
b5 * bslAge_i

and the contrast  CM.M = [0 0 0 1 0 0]. Is this a correct way of doing it or 
did I misinterpret something?

Thank you.
-Donatas


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-19 Thread Livia Liu
Dear Martin,


 Thank you so much for all the help that you had given me.


Kind regards,

Livia
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-14 Thread Martin Reuter
Hi Livia, 

I cannot help you, as I don’t know about the cluster analysis etc, maybe 
someone else does. 

Here some quick answers as far as what I know:

1. when running the test with
F_lhstats = lme_mass_F(lhstats,CM);
you get a structure F_lhstats which should also contain the F . 
Also take a look at fs_write_fstasts which can write out the signed  F 
statistic map to a file. 

2. don’t know

3. don’t know

4. Not sure this is even possible. The thickness in FreeSurfer is attached to 
the vertices on the surface. You loose so much information if you resample this 
to the volume, and could be very inaccurate . 

Best, Martin


> On 14. Jun 2017, at 14:19, Livia Liu  wrote:
> 
> Dear Martin,
> 
> 
> Thank you very much again for your reply. I did better with your help, but I 
> am really sorry that I still have some questions.
> 
> 
> 
> 
> 1. I found there are positive and negative regions in the result “sig.mgh” 
> map. I wonder “lme_mass_F” is a kind of F analysis or T analysis in fact. How 
> to get the F value or T value? I can only get P value.
>  
> 2. And I tried to use the cmd “mri_surfcluster” to generate the set of 
> detected clusters and their anatomical coordinates like the file 
> "...sig.cluster.summary" in GLM analysis. Unfortunately,I failed to get the 
> correct command. Could you tell me right way?
> 
> 3. I load sig.mgh file and save ROIs’ label file in qdec tool, then I use the 
> cmd "mri_label2label" and "mris_anatomical_stats" to get the value of 
> thickness. For area and volume, can I get in the same way? In the stats:# 
> ColHeaders StructName NumVert SurfArea GrayVol ThickAvg ThickStd MeanCurv 
> GausCurv FoldInd CurvInd
> lh.1.label 25 19 51   3.044 0.237 0.105 0.0680
>  0
> 
> I think that the “SurfArea” is the value of area, “GrayVol” is the value of 
> volume.In my other GLM analysis, I found that cortical surface area or volume 
> is not an integer in the file “…y.ocn.dat”.Is it right way to get the ROI 
> value? 
> 
> 
> 
> 4.If there are any way to convert the file “lh.thickness”"lh.area" or 
> "lh.volume" in every subject to the format “nii” which can be used in SPM. I 
> want to do a same analysis in SPM to compare my result. 
> I use the cmd: mri_surf2vol --surfval $SUBJECTS_DIR/sub01/surf/lh.thickness 
> --hemi lh --fillribbon --subject fsaverage --template 
> $SUBJECTS_DIR/fsaverage/mri/orig --o lh.thickness01.nii 
> 
> then I use the cmd: tkregister2 --mov $SUBJECTS_DIR/fsaverage/mri/orig.mgz 
> --noedit --s fsaverage --regheader --reg $SUBJECTS_DIR/register.dat
> 
> But in the terminal output: A volume registration file must be supplied.
> 
> I don’t know how to get the volume registration file. I failed to get the 
> correct cmd by searching in mail-list. Please give me some help.
> 
> I am sorry again to bring you a lot of questions.  Thank you very much, and 
> looking forward to reply.
> 
> 
> 
> Kind regards,
> 
> 
> Livia
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-14 Thread Livia Liu
Dear Martin,

Thank you very much again for your reply. I did better with your help, but
I am really sorry that I still have some questions.



1. I found there are positive and negative regions in the result “sig.mgh”
map. I wonder “lme_mass_F” is a kind of F analysis or T analysis in fact.
How to get the F value or T value? I can only get P value.



2. And I tried to use the cmd “mri_surfcluster” to generate the set of
detected clusters and their anatomical coordinates like the file
"...sig.cluster.summary" in GLM analysis. Unfortunately,I failed to get the
correct command. Could you tell me right way?


3. I load sig.mgh file and save ROIs’ label file in qdec tool, then I use
the cmd "mri_label2label" and "mris_anatomical_stats" to get the value of
thickness. For area and volume, can I get in the same way? In the stats:#
ColHeaders StructName NumVert SurfArea GrayVol ThickAvg ThickStd MeanCurv
GausCurv FoldInd CurvInd

lh.1.label 25 19 51   3.044 0.237 0.105 0.068
0 0

I think that the “SurfArea” is the value of area, “GrayVol” is the value of
volume.In my other GLM analysis, I found that cortical surface area or
volume is not an integer in the file “…y.ocn.dat”.Is it right way to get
the ROI value?


4.If there are any way to convert the file “lh.thickness”"lh.area" or
"lh.volume" in every subject to the format “nii” which can be used in SPM. I
want to do a same analysis in SPM to compare my result.

I use the cmd: mri_surf2vol --surfval $SUBJECTS_DIR/sub01/surf/lh.thickness
--hemi lh --fillribbon --subject fsaverage --template
$SUBJECTS_DIR/fsaverage/mri/orig --o lh.thickness01.nii

then I use the cmd: tkregister2 --mov $SUBJECTS_DIR/fsaverage/mri/orig.mgz
--noedit --s fsaverage --regheader --reg $SUBJECTS_DIR/register.dat

But in the terminal output: A volume registration file must be supplied.

I don’t know how to get the volume registration file. I failed to get the
correct cmd by searching in mail-list. Please give me some help.

I am sorry again to bring you a lot of questions.  Thank you very much, and
looking forward to reply.


Kind regards,

Livia
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-12 Thread Martin Reuter

Hi Livia,

[1] only the intercept is used as random effect in the model

[1 2 ] both intercept and time (slopes) are used as random effect in the 
model. Here many more parameters get estimated so you need to have 
sufficient data. Often the more simple approach is better (but that can 
be tested by comparing the models, described on the wiki).


FDR correction can be done independent of the vertex wise or region wise 
approach.


The region-wise approach may be better (it definitely should be faster, 
but also benefits from some more statistical power).


this is a LME model, which is different from standard  GLM models.  The 
interaction of group and time is slope (e.g. atroph rate) difference 
across groups ( C = [ 0 0 0 1]). I explained it in detail in my last email.


Best, Martin


On 06/06/2017 03:50 PM, Livia Liu wrote:

Dear Martin,
Thank you very much for your quick reply.
I use voxel-wise mixed model analysis, and I see different design:
lhstats = lme_mass_fit_vw(X,[1],Y,ni,lhcortex);Summary: Algorithm did not 
converge at 0 percent of the total number of locations.
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex);Summary: Algorithm did not 
converge at 9.231.. percent of...
What the meaning and difference between [1] [1 2] or other?
In the end of the pagehttps://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
  
It use Region-wise linear mixed-effects estimation:lme_mass_fit_Rgw , then do FDR.

Sorry, I can not make sure how to do FDR in my result.Please tell me some 
details.
And should I try this Region-wise model in my analysis?
My purpose is to compare cortical thickness changes in patient group after 
treatment and  placebo group in 2 time points.
Then You say in the second mail:(if longitudinal slopes = atrophy rates, differ 
across groups),I am so sorry that I can't understand.
If I get the interaction result, how to explain?
I wonder I must get the main effect about the time or group to measure what 
cause the interaction.
  
Could you please give me some direction? Looking forward to reply, and thanks very much.

Kind regards,
Livia

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-06 Thread Livia Liu
Dear Martin,
Thank you very much for your quick reply.

I use voxel-wise mixed model analysis, and I see different design:


lhstats = lme_mass_fit_vw(X,[1],Y,ni,lhcortex);Summary: Algorithm
did not converge at 0 percent of the total number of locations.

lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex);Summary:
Algorithm did not converge at 9.231.. percent of...


What the meaning and difference between [1] [1 2] or other?


In the end of the page
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels

It use Region-wise linear mixed-effects estimation:lme_mass_fit_Rgw ,
then do FDR.


Sorry, I can not make sure how to do FDR in my result.Please tell me
some details.

And should I try this Region-wise model in my analysis?


My purpose is to compare cortical thickness changes in patient group
after treatment and  placebo group in 2 time points.

Then You say in the second mail:(if longitudinal slopes = atrophy
rates, differ across groups),I am so sorry that I can't understand.

If I get the interaction result, how to explain?

I wonder I must get the main effect about the time or group to measure
what cause the interaction.

 Could you please give me some direction? Looking forward to reply,
and thanks very much.


Kind regards,
Livia
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-06 Thread Martin Reuter
Hi Livia, 

yes, 0 0 0 1 is the interaction (if longitudinal slopes = atrophy rates, differ 
across groups).

When interpreting these, it makes sense to look at your model:

Y_ij = b0 + b1 t_ij + b2 g_i + b3 t_ij g_i
where t is time, g is group. 
For group=0 you have
Y_ij = b0 + b1 t_ij
so b0 is the intercept of group_0, and b1 the slope

For group=1 you have
Y_ij= ( b0 + b2 ) + (b1 + b3) t_ij
so (b0 + b2) is the intercept for group_1 and (b1 + b3) the slope. 

So slope difference across groups is (b1 + b3) - b1 = b3so c=( 0 0 0 1 )  
(this is group_1 minus group_0)
and intercept difference is (b0 + b2 ) - b0 = b2,   so c = ( 0 0 1 0 )

Average slope across both groups is: 

0.5 * (b1 + b3 + b1) = b1 + 0.5 b3soc =( 0 1 0 0.5 )

Best, Martin


> On 6. Jun 2017, at 07:44, Livia Liu  wrote:
> 
> Dear FS experts,
> I want to add some in my early mail.
> If the contrast CM.C= [0 0 0 1] is designed for the interaction effect(time 
> and group).
> How to design contrasts to do the main effect about the time and group?
> CM.C=[0 1 0 1] and CM.C=[0 0 1 1]? Or other? 
> I wonder I may be wrong in designing matrix X in early mail. 
> Please help me.Looking forward to reply, and thanks very much.
> Kind regards,
> Livia
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-06 Thread Martin Reuter
Hi Livia, 

groups should be 0 and 1, e.g. 0 for controls, 1 for disease.

Order of groups does not matter (as long as both X and Y are ordered that way). 

You can do FDR or FDR2 on your final sig values. It is best to combine results 
from left and right hemisphere and do a single FDR2 correction. 
This is described at the end of this page:
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
 

Best, Martin



> On 6. Jun 2017, at 04:24, Livia Liu  wrote:
> 
> Dear FS experts,
> I are analysing longitudinal data - the difference between 2 groups (1 and 2) 
> with 2 time points for each group (0, 1 --all the same time interval: a 
> month).
> I followed  http://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
>  
> and with Jorge's early reply in 
> http://www.mail-achive.com/freesurfer@nmr.mgh.harvard.edu/msg25750.html 
> 
> (1)qdec.table.dat
> fsid fsid-base time group
> sub04_MR1 sub04 0 1
> sub04_MR2 sub04 1 1
> sub05_MR1 sub05 0 1
> sub05_MR1 sub05 1 1
> ...
> con01_MR1 con01 0 2
> con01_MR1 con01 1 2
> con01_MR1 con01 0 2
> con01_MR1 con01 1 2
> ...
> (2) mris_preproc --qdec-long qdec.table.dat --target fsaverage --hemi lh 
> --meas thickness --out lh.thickness.mgh
>  mri_surf2surf --hemi lh --s fsaverage --sval lh.thickness.mgh --tval 
> lh.thickness_sm10.mgh --fwhm-trg 10 --cortex  --noreshape
> (3) [Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');
> lhsphere=fs_read_surf('$FsDir/freesurfer/subjects/fsaverage/surf/lh.sphere');
> lhcortex=fs_read_label('$FsDir/freesurfer/subjects/fsaverage/surf/lh.cortex.label');
> (4)Qdec = fReadQdec('qdec.table.dat');
>Qdec = rmQdecCol(Qdec,1);
>sID = Qdec(2:end,1);
>Qdec = rmQdecCol(Qdec,1);
>M = Qdec2num(Qdec);
>   [M,Y,ni] = sortData(M,1,Y,sID);
>X = [ones(length(M),1) M M(:,1).*M(:,2)];
> But when I followed wiki,code[M,Y,ni]first,  matrix X will be four 
> columns:
>1-A column of 1s(intercept term)
>2-The time covariate (0s and 1s)
>3-The group covariate (2s and 1s,but in my table group 1 in the first, I 
> think maybe it upside down?So I used the code X before code[M,Y,ni],then it 
> will be 1s and 2s)
>4-The group and time interaction (It is also affected by the third column 
> to change).
> Is my use correct here? I think it will be influn
> (5)Then I used voxel-wise mixed model analysis following Jorge's reply.
> lhstats = lme_mass_fit_vw(X,[1],Y,ni,lhcortex);
> CM.C = [0 0 0 1];
> F_lhstats = lme_mass_F(lhstats,CM);
> (6)fs_write_fstats(F_stats,mri,'sig.mgh','sig');
> How to do correction about the result 'sig.mgh'?
> May I use lme_mass_FDR or lme_mass_FDR2? How to do?
> And if I can have a file including clusters' massage like summary file? 
> I can't do a mri_glmfit-sim or mc-z in QDEC, and FDR in QDEC, maybe the 
> t-value to high,there are nothing left.
> Please give me some help.Thank you very much, and looking forward to your 
> reply!
> 
> 
> 
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME correction in longitudinal analysis

2017-06-05 Thread Livia Liu
Dear FS experts,
I want to add some in my early mail.
If the contrast CM.C= [0 0 0 1] is designed for the interaction effect(time
and group).
How to design contrasts to do the main effect about the time and group?
CM.C=[0 1 0 1] and CM.C=[0 0 1 1]? Or other?
I wonder I may be wrong in designing matrix X in early mail.
Please help me.Looking forward to reply, and thanks very much.
Kind regards,
Livia
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME correction in longitudinal analysis

2017-06-05 Thread Livia Liu
Dear FS experts,

I are analysing longitudinal data - the difference between 2 groups (1
and 2) with 2 time points for each group (0, 1 --all the same time
interval: a month).

I followed  http://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels

and with Jorge's early reply in
http://www.mail-achive.com/freesurfer@nmr.mgh.harvard.edu/msg25750.html

(1)qdec.table.dat

fsid fsid-base time group

sub04_MR1 sub04 0 1

sub04_MR2 sub04 1 1

sub05_MR1 sub05 0 1

sub05_MR1 sub05 1 1

...

con01_MR1 con01 0 2

con01_MR1 con01 1 2

con01_MR1 con01 0 2

con01_MR1 con01 1 2

...

(2) mris_preproc --qdec-long qdec.table.dat --target fsaverage --hemi
lh --meas thickness --out lh.thickness.mgh

 mri_surf2surf --hemi lh --s fsaverage --sval lh.thickness.mgh --tval
lh.thickness_sm10.mgh --fwhm-trg 10 --cortex  --noreshape

(3) [Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');

lhsphere=fs_read_surf('$FsDir/freesurfer/subjects/fsaverage/surf/lh.sphere');

lhcortex=fs_read_label('$FsDir/freesurfer/subjects/fsaverage/surf/lh.cortex.label');

(4)Qdec = fReadQdec('qdec.table.dat');

   Qdec = rmQdecCol(Qdec,1);

   sID = Qdec(2:end,1);

   Qdec = rmQdecCol(Qdec,1);

   M = Qdec2num(Qdec);

  [M,Y,ni] = sortData(M,1,Y,sID);

   X = [ones(length(M),1) M M(:,1).*M(:,2)];

But when I followed wiki,code[M,Y,ni]first,  matrix X will be four columns:

   1-A column of 1s(intercept term)

   2-The time covariate (0s and 1s)

   3-The group covariate (2s and 1s,but in my table group 1 in the
first, I think maybe it upside down?So I used the code X before
code[M,Y,ni],then it will be 1s and 2s)

   4-The group and time interaction (It is also affected by the third
column to change).

Is my use correct here? I think it will be influn

(5)Then I used voxel-wise mixed model analysis following Jorge's reply.

lhstats = lme_mass_fit_vw(X,[1],Y,ni,lhcortex);

CM.C = [0 0 0 1];

F_lhstats = lme_mass_F(lhstats,CM);

(6)fs_write_fstats(F_stats,mri,'sig.mgh','sig');

How to do correction about the result 'sig.mgh'?

May I use lme_mass_FDR or lme_mass_FDR2? How to do?

And if I can have a file including clusters' massage like summary file?

I can't do a mri_glmfit-sim or mc-z in QDEC, and FDR in QDEC, maybe
the t-value to high,there are nothing left.

Please give me some help.Thank you very much, and looking forward to your reply!
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-23 Thread Martin Reuter

Hi Matthieu,


Y = b0 + b1 tij + b2 si + b3 si * tij

(Y thickness, b0 intercept, b1 slope, b2 score, b3 score effect on 
slope, where t_ij is the time of subject i at time point j, s_i is 
subject score)


  = (b0 + b2 si) + (b1 + b3 si) tij

so the slope is made up of (b1 + b3 si), a global component and a 
subject component that adds or subtracts to the slope based on the 
score. If the b3 is positive, the slope gets larger with increasing 
score. Here larger means closer to zero if the slope was negative, so 
less atrophy or even brain growth.


If b3 is negative, the slope gets smaller with increasing score: more 
atrophy or less brain growth, depending on b1.


Best Martin


On 05/18/2017 01:12 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you this helps !

Please find last question below inline.

Best,
Matthieu

Le 18 mai 2017 10:33 AM, "Martin Reuter" > a écrit :


Hi Matthieu,


1) you would put a column of score and a column of score X time. 
The first allows you to test if the intercept changes based on

scores (e.g. if hippocampal volume is affected by the score,
controlling for whatever else you included, e.g. age and gender
etc) and the second interaction allows you to test if the the
slopes are affected by score (so if atrophy rates are different at
different score levels).

2) if your effect for that interaction column is positive, there
is a positive correlation (higher score, slower atrophy (or even
brain growth), and lower score with faster atrophy - this is what
you would expect) if there is a negative effect, it would mean the
opposite.

How do you deduce this from combination of atrophy, score and time ?
I know that positive leads to positive correlation and when group X 
time is negative means that cortical thickness decreases with time.
However I can't manage to understand relation between cortical 
thickness and score X time. Could you explain me ?


Best, Martin


On 05/17/2017 11:12 PM, Matthieu Vanhoutte wrote:

Hi Martin,

I will read up on interpretation of time varying covariates.

If initially I use score as variable fixed across time, and
define a variable for 'score x time' interaction:
1) Would putting only 1 to 'score x time' column (for contrast)
test for progression of correlation patterns between atrophy and
score ?
2) How to interpret this according to sign  of contrast (knowing
that decrease in score means worse performance) ?

Many thanks for your time and lights !

Best,
Matthieu

Le 17 mai 2017 1:46 PM, "Martin Reuter"
> a écrit :

Hi Matthieu,

replacing time by score is very different from adding score
as a covariate. Often scores are crude and often they are
constant in controls (always full score), and only vary
slightly in diseased. In those cases it may not be good to
use score as a time variable.

I would either add avg. score as a variable (fixed across
time - would probably do this for intial testing anyway) or
score as time-varying covariate, but would read up on how to
interpret results in the presence of time-varying-covariates.
I am not a statistician.

Best, Martin


On 05/16/2017 08:09 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you for this detailed answer.

Are replacing time by score or include score as time-varying
covariate leading to the same result because of looking at
the same effect ?

My willing would be to find patterns of atrophy
rate/progression correlated with cognitive score. In context
of AD which method would be the best for you ?

Best,
Matthieu


Le 16 mai 2017 11:17 AM, "Martin Reuter"
> a écrit :

Hi Matthieu,

one option is to replace time with score in the model.
That should be straight forward.

The other option is to include score as a time-varying
covariate. If your score is not varying much across time
and you are more interested if the average score (or
baseline score) affects atrophy rates, you can also
include is as a standard (fixed across time) co-variate
(such as baseline age) with a time (and a group etc)
interaction.

Sorry, but I cannot do your design. Ultimately the model
is the research question that you are asking and it is
important that this is done correctly. Maybe there is a
local biostats person that you can talk to?

Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

 

Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-18 Thread Matthieu Vanhoutte
Hi Martin,

Thank you this helps !

Please find last question below inline.

Best,
Matthieu

Le 18 mai 2017 10:33 AM, "Martin Reuter"  a
écrit :

Hi Matthieu,


1) you would put a column of score and a column of score X time.  The first
allows you to test if the intercept changes based on scores (e.g. if
hippocampal volume is affected by the score, controlling for whatever else
you included, e.g. age and gender etc) and the second interaction allows
you to test if the the slopes are affected by score (so if atrophy rates
are different at different score levels).

2) if your effect for that interaction column is positive, there is a
positive correlation (higher score, slower atrophy (or even brain growth),
and lower score with faster atrophy - this is what you would expect) if
there is a negative effect, it would mean the opposite.

How do you deduce this from combination of atrophy, score and time ?
I know that positive leads to positive correlation and when group X time is
negative means that cortical thickness decreases with time.
However I can't manage to understand relation between cortical thickness
and score X time. Could you explain me ?

Best, Martin


On 05/17/2017 11:12 PM, Matthieu Vanhoutte wrote:

Hi Martin,

I will read up on interpretation of time varying covariates.

If initially I use score as variable fixed across time, and define a
variable for 'score x time' interaction:
1) Would putting only 1 to 'score x time' column (for contrast) test for
progression of correlation patterns between atrophy and score ?
2) How to interpret this according to sign  of contrast (knowing that
decrease in score means worse performance) ?

Many thanks for your time and lights !

Best,
Matthieu

Le 17 mai 2017 1:46 PM, "Martin Reuter"  a
écrit :

Hi Matthieu,

replacing time by score is very different from adding score as a covariate.
Often scores are crude and often they are constant in controls (always full
score), and only vary slightly in diseased. In those cases it may not be
good to use score as a time variable.

I would either add avg. score as a variable (fixed across time - would
probably do this for intial testing anyway) or score as time-varying
covariate, but would read up on how to interpret results in the presence of
time-varying-covariates. I am not a statistician.
Best, Martin


On 05/16/2017 08:09 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you for this detailed answer.

Are replacing time by score or include score as time-varying covariate
leading to the same result because of looking at the same effect ?

My willing would be to find patterns of atrophy rate/progression correlated
with cognitive score. In context of AD which method would be the best for
you ?

Best,
Matthieu


Le 16 mai 2017 11:17 AM, "Martin Reuter"  a
écrit :

Hi Matthieu,

one option is to replace time with score in the model. That should be
straight forward.

The other option is to include score as a time-varying covariate. If your
score is not varying much across time and you are more interested if the
average score (or baseline score) affects atrophy rates, you can also
include is as a standard (fixed across time) co-variate (such as baseline
age) with a time (and a group  etc) interaction.

Sorry, but I cannot do your design. Ultimately the model is the research
question that you are asking and it is important that this is done
correctly. Maybe there is a local biostats person that you can talk to?

Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you. How should this variable be coded ? Should it be as age
covariate where age at baseline is used along all time points of each
subject ?

Could you provide me an example of design matrix, I don't manage to see
what does it look like to.

Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter"  a
écrit :

Hi Matthieu,

yes, that is possible. Instead of group, you use a variable for your score
(and interaction etc). Sometimes it may also makes sense to use score
instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte 
wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't found any answer to
my question.
>
> Is it possible with LME model to make correlations between for example
cortical thickness surface data and cognition scores along time ? As it is
possible to test for interaction of group X time, is this also in the same
way feasible to test for coognition score X time on cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list

Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-18 Thread Martin Reuter

Hi Matthieu,


1) you would put a column of score and a column of score X time. The 
first allows you to test if the intercept changes based on scores (e.g. 
if hippocampal volume is affected by the score, controlling for whatever 
else you included, e.g. age and gender etc) and the second interaction 
allows you to test if the the slopes are affected by score (so if 
atrophy rates are different at different score levels).


2) if your effect for that interaction column is positive, there is a 
positive correlation (higher score, slower atrophy (or even brain 
growth), and lower score with faster atrophy - this is what you would 
expect) if there is a negative effect, it would mean the opposite.


Best, Martin


On 05/17/2017 11:12 PM, Matthieu Vanhoutte wrote:

Hi Martin,

I will read up on interpretation of time varying covariates.

If initially I use score as variable fixed across time, and define a 
variable for 'score x time' interaction:
1) Would putting only 1 to 'score x time' column (for contrast) test 
for progression of correlation patterns between atrophy and score ?
2) How to interpret this according to sign  of contrast (knowing that 
decrease in score means worse performance) ?


Many thanks for your time and lights !

Best,
Matthieu

Le 17 mai 2017 1:46 PM, "Martin Reuter" > a écrit :


Hi Matthieu,

replacing time by score is very different from adding score as a
covariate. Often scores are crude and often they are constant in
controls (always full score), and only vary slightly in diseased.
In those cases it may not be good to use score as a time variable.

I would either add avg. score as a variable (fixed across time -
would probably do this for intial testing anyway) or score as
time-varying covariate, but would read up on how to interpret
results in the presence of time-varying-covariates. I am not a
statistician.

Best, Martin


On 05/16/2017 08:09 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you for this detailed answer.

Are replacing time by score or include score as time-varying
covariate leading to the same result because of looking at the
same effect ?

My willing would be to find patterns of atrophy rate/progression
correlated with cognitive score. In context of AD which method
would be the best for you ?

Best,
Matthieu


Le 16 mai 2017 11:17 AM, "Martin Reuter"
> a écrit :

Hi Matthieu,

one option is to replace time with score in the model. That
should be straight forward.

The other option is to include score as a time-varying
covariate. If your score is not varying much across time and
you are more interested if the average score (or baseline
score) affects atrophy rates, you can also include is as a
standard (fixed across time) co-variate (such as baseline
age) with a time (and a group  etc) interaction.

Sorry, but I cannot do your design. Ultimately the model is
the research question that you are asking and it is important
that this is done correctly. Maybe there is a local biostats
person that you can talk to?

Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you. How should this variable be coded ? Should it be
as age covariate where age at baseline is used along all
time points of each subject ?

Could you provide me an example of design matrix, I don't
manage to see what does it look like to.

Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter"
> a écrit :

Hi Matthieu,

yes, that is possible. Instead of group, you use a
variable for your score (and interaction etc). Sometimes
it may also makes sense to use score instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte
> wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't
found any answer to my question.
>
> Is it possible with LME model to make correlations
between for example cortical thickness surface data and
cognition scores along time ? As it is possible to test
for interaction of group X time, is this also in the
same way feasible to test for coognition score X time on
cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
 

Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-17 Thread Matthieu Vanhoutte
Hi Martin,

I will read up on interpretation of time varying covariates.

If initially I use score as variable fixed across time, and define a
variable for 'score x time' interaction:
1) Would putting only 1 to 'score x time' column (for contrast) test for
progression of correlation patterns between atrophy and score ?
2) How to interpret this according to sign  of contrast (knowing that
decrease in score means worse performance) ?

Many thanks for your time and lights !

Best,
Matthieu

Le 17 mai 2017 1:46 PM, "Martin Reuter"  a
écrit :

Hi Matthieu,

replacing time by score is very different from adding score as a covariate.
Often scores are crude and often they are constant in controls (always full
score), and only vary slightly in diseased. In those cases it may not be
good to use score as a time variable.

I would either add avg. score as a variable (fixed across time - would
probably do this for intial testing anyway) or score as time-varying
covariate, but would read up on how to interpret results in the presence of
time-varying-covariates. I am not a statistician.
Best, Martin


On 05/16/2017 08:09 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you for this detailed answer.

Are replacing time by score or include score as time-varying covariate
leading to the same result because of looking at the same effect ?

My willing would be to find patterns of atrophy rate/progression correlated
with cognitive score. In context of AD which method would be the best for
you ?

Best,
Matthieu


Le 16 mai 2017 11:17 AM, "Martin Reuter"  a
écrit :

Hi Matthieu,

one option is to replace time with score in the model. That should be
straight forward.

The other option is to include score as a time-varying covariate. If your
score is not varying much across time and you are more interested if the
average score (or baseline score) affects atrophy rates, you can also
include is as a standard (fixed across time) co-variate (such as baseline
age) with a time (and a group  etc) interaction.

Sorry, but I cannot do your design. Ultimately the model is the research
question that you are asking and it is important that this is done
correctly. Maybe there is a local biostats person that you can talk to?

Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you. How should this variable be coded ? Should it be as age
covariate where age at baseline is used along all time points of each
subject ?

Could you provide me an example of design matrix, I don't manage to see
what does it look like to.

Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter"  a
écrit :

Hi Matthieu,

yes, that is possible. Instead of group, you use a variable for your score
(and interaction etc). Sometimes it may also makes sense to use score
instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte 
wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't found any answer to
my question.
>
> Is it possible with LME model to make correlations between for example
cortical thickness surface data and cognition scores along time ? As it is
possible to test for interaction of group X time, is this also in the same
way feasible to test for coognition score X time on cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




___
Freesurfer mailing
listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___ Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.e
du/mailman/listinfo/freesurfer The information in this e-mail is intended
only for the person to whom it is addressed. If you believe this e-mail was
sent to you in error and the e-mail contains patient information, please
contact the Partners Compliance HelpLine at http://www.partners.org/compli
anceline . If the e-mail was sent to you in error but does not contain
patient information, please contact the sender and properly dispose of the
e-mail.


Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-17 Thread Martin Reuter

Hi Matthieu,

replacing time by score is very different from adding score as a 
covariate. Often scores are crude and often they are constant in 
controls (always full score), and only vary slightly in diseased. In 
those cases it may not be good to use score as a time variable.


I would either add avg. score as a variable (fixed across time - would 
probably do this for intial testing anyway) or score as time-varying 
covariate, but would read up on how to interpret results in the presence 
of time-varying-covariates. I am not a statistician.


Best, Martin

On 05/16/2017 08:09 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you for this detailed answer.

Are replacing time by score or include score as time-varying covariate 
leading to the same result because of looking at the same effect ?


My willing would be to find patterns of atrophy rate/progression 
correlated with cognitive score. In context of AD which method would 
be the best for you ?


Best,
Matthieu


Le 16 mai 2017 11:17 AM, "Martin Reuter" > a écrit :


Hi Matthieu,

one option is to replace time with score in the model. That should
be straight forward.

The other option is to include score as a time-varying covariate.
If your score is not varying much across time and you are more
interested if the average score (or baseline score) affects
atrophy rates, you can also include is as a standard (fixed across
time) co-variate (such as baseline age) with a time (and a group 
etc) interaction.


Sorry, but I cannot do your design. Ultimately the model is the
research question that you are asking and it is important that
this is done correctly. Maybe there is a local biostats person
that you can talk to?

Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you. How should this variable be coded ? Should it be as
age covariate where age at baseline is used along all time points
of each subject ?

Could you provide me an example of design matrix, I don't manage
to see what does it look like to.

Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter"
> a écrit :

Hi Matthieu,

yes, that is possible. Instead of group, you use a variable
for your score (and interaction etc). Sometimes it may also
makes sense to use score instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte
> wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't found
any answer to my question.
>
> Is it possible with LME model to make correlations between
for example cortical thickness surface data and cognition
scores along time ? As it is possible to test for interaction
of group X time, is this also in the same way feasible to
test for coognition score X time on cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu

>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu

https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



The information in this e-mail is intended only for the
person to whom it is
addressed. If you believe this e-mail was sent to you in
error and the e-mail
contains patient information, please contact the Partners
Compliance HelpLine at
http://www.partners.org/complianceline
 . If the e-mail was
sent to you in error
but does not contain patient information, please contact the
sender and properly
dispose of the e-mail.




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu

https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___ Freesurfer mailing
list Freesurfer@nmr.mgh.harvard.edu


Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-16 Thread Matthieu Vanhoutte
Hi Martin,

Thank you for this detailed answer.

Are replacing time by score or include score as time-varying covariate
leading to the same result because of looking at the same effect ?

My willing would be to find patterns of atrophy rate/progression correlated
with cognitive score. In context of AD which method would be the best for
you ?

Best,
Matthieu


Le 16 mai 2017 11:17 AM, "Martin Reuter"  a
écrit :

Hi Matthieu,

one option is to replace time with score in the model. That should be
straight forward.

The other option is to include score as a time-varying covariate. If your
score is not varying much across time and you are more interested if the
average score (or baseline score) affects atrophy rates, you can also
include is as a standard (fixed across time) co-variate (such as baseline
age) with a time (and a group  etc) interaction.

Sorry, but I cannot do your design. Ultimately the model is the research
question that you are asking and it is important that this is done
correctly. Maybe there is a local biostats person that you can talk to?

Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you. How should this variable be coded ? Should it be as age
covariate where age at baseline is used along all time points of each
subject ?

Could you provide me an example of design matrix, I don't manage to see
what does it look like to.

Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter"  a
écrit :

Hi Matthieu,

yes, that is possible. Instead of group, you use a variable for your score
(and interaction etc). Sometimes it may also makes sense to use score
instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte 
wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't found any answer to
my question.
>
> Is it possible with LME model to make correlations between for example
cortical thickness surface data and cognition scores along time ? As it is
possible to test for interaction of group X time, is this also in the same
way feasible to test for coognition score X time on cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




___
Freesurfer mailing
listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-16 Thread Martin Reuter

Hi Matthieu,

one option is to replace time with score in the model. That should be 
straight forward.


The other option is to include score as a time-varying covariate. If 
your score is not varying much across time and you are more interested 
if the average score (or baseline score) affects atrophy rates, you can 
also include is as a standard (fixed across time) co-variate (such as 
baseline age) with a time (and a group etc) interaction.


Sorry, but I cannot do your design. Ultimately the model is the research 
question that you are asking and it is important that this is done 
correctly. Maybe there is a local biostats person that you can talk to?


Best, Martin



On 05/15/2017 08:20 PM, Matthieu Vanhoutte wrote:

Hi Martin,

Thank you. How should this variable be coded ? Should it be as age 
covariate where age at baseline is used along all time points of each 
subject ?


Could you provide me an example of design matrix, I don't manage to 
see what does it look like to.


Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter" > a écrit :


Hi Matthieu,

yes, that is possible. Instead of group, you use a variable for
your score (and interaction etc). Sometimes it may also makes
sense to use score instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte
>
wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't found any
answer to my question.
>
> Is it possible with LME model to make correlations between for
example cortical thickness surface data and cognition scores along
time ? As it is possible to test for interaction of group X time,
is this also in the same way feasible to test for coognition score
X time on cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu

> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu 
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



The information in this e-mail is intended only for the person to
whom it is
addressed. If you believe this e-mail was sent to you in error and
the e-mail
contains patient information, please contact the Partners
Compliance HelpLine at
http://www.partners.org/complianceline
 . If the e-mail was sent
to you in error
but does not contain patient information, please contact the
sender and properly
dispose of the e-mail.




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-15 Thread Matthieu Vanhoutte
Hi Martin,

Thank you. How should this variable be coded ? Should it be as age
covariate where age at baseline is used along all time points of each
subject ?

Could you provide me an example of design matrix, I don't manage to see
what does it look like to.

Best regards,
Matthieu


Le 14 mai 2017 8:08 PM, "Martin Reuter"  a
écrit :

Hi Matthieu,

yes, that is possible. Instead of group, you use a variable for your score
(and interaction etc). Sometimes it may also makes sense to use score
instead of time.

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte 
wrote:
>
> Dear Freesurfer's experts,
>
> I have searched through the mailing list but haven't found any answer to
my question.
>
> Is it possible with LME model to make correlations between for example
cortical thickness surface data and cognition scores along time ? As it is
possible to test for interaction of group X time, is this also in the same
way feasible to test for coognition score X time on cortical thickness ?
>
> Many thanks for your advice !
>
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-14 Thread Martin Reuter
Hi Matthieu, 

yes, that is possible. Instead of group, you use a variable for your score (and 
interaction etc). Sometimes it may also makes sense to use score instead of 
time. 

Best, Martin


> On 12 May 2017, at 10:51, Matthieu Vanhoutte  
> wrote:
> 
> Dear Freesurfer's experts,
> 
> I have searched through the mailing list but haven't found any answer to my 
> question.
> 
> Is it possible with LME model to make correlations between for example 
> cortical thickness surface data and cognition scores along time ? As it is 
> possible to test for interaction of group X time, is this also in the same 
> way feasible to test for coognition score X time on cortical thickness ?
> 
> Many thanks for your advice !
> 
> Best regards,
> Matthieu
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.



[Freesurfer] LME : longitudinal correlations between imaging and cognition scores

2017-05-12 Thread Matthieu Vanhoutte
Dear Freesurfer's experts,

I have searched through the mailing list but haven't found any answer to my
question.

Is it possible with LME model to make correlations between for example
cortical thickness surface data and cognition scores along time ? As it is
possible to test for interaction of group X time, is this also in the same
way feasible to test for coognition score X time on cortical thickness ?

Many thanks for your advice !

Best regards,
Matthieu
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME mass univariate model

2017-03-22 Thread Bronwyn Overs
Hi Mailing List,

I am fitting an LME model with random effects for B0 and B2, so I am using the 
following to fit a spatiotemporal model:

lhstats = lme_mass_fit_Rgw(X,[1 3],Y,ni,lhTh0,lhRgs,lhsphere);

However, prior to this when i am computing the initial temporal covariance 
estimates, do the square bracketed numbers refer to the random effects as well? 
So would this be run for random effects at B0 and B2:

[lhTh0,lhRe] = lme_mass_fit_EMinit(X,[1 3],Y,ni,lhcortex,3);

Kind regards,
Bronwyn Overs
Research Assistant

Neuroscience Research Australia
Margarete Ainsworth Building
Barker Street Randwick Sydney NSW 2031 Australia
M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265

neura.edu.au  
  
 

> On 7 Mar 2017, at 11:57 pm, Martin Reuter  wrote:
> 
> Hi Bronwyn, 
> 
> to shorten equations, lets set t = years_form_baseline
> a = age
> g = group
> s = sex
> 
> so your model is
> Y_ij = b0 + b1 t_ij + b2 a_i + b3 g_i + b4 s_i + b5 t_ij a_i + b6 t_ij g_i + 
> b7 a_i g_i + b8 t_ij a_i g_i
> (as a fist step, I would consider simplifying it, by dropping the age 
> interactions). 
> 
> Anyway
> 
> for male (s_i =0) and controls (g_i = 0) this reduces to
> Y_ij = b0 + b1 t_ij + b2 a_i + b5 t_ij a_i 
> so b1 is the slope for male controls, controlling for age and the slope age 
> interaction. (0 1 0….)
> 
> Now for female (s=1) patients (g=1) we get this:
> 
> Y_ij = b0 + b1 t_ij + b2 a_i + b3  + b4 + b5 t_ij a_i + b6 t_ij + b7 a_i + b8 
> t_ij
>= (b0+b3+b4) + (b1 + b6 + b8 ) t_ij + (b2+b7) a_i + b5 t_ij a_i 
> So the slope for female patients (controlling for age and age time 
> interaction) would be
> (b1 + b6 + b8)
> 0 1 0 0 0 0 1 0 1
> 
> The difference in slope between female patients and male controls would be
> 0 0 0 0 0 0 1 0 1 (or the negative of that depending which way you subtract). 
> Similarly you can look at group differences (controlling for age gender and 
> interactions). 
> 
> Always write out the full model to make sure you understand what you are 
> doing. 
> 
> To complete the picture, here is the contrast for the slope of male patients
> 0 1 0 0 0 0 1 0 1 (it is the same as for female patients, because you don’t 
> have a timeXgender interaction. So that is your patient slope )
> Therefore the 
> 0 0 0 0 0 0 1 0 1  is the slope difference between the groups. 
> 
> I would recommend you talk to a local biostatistician, to make sure you are 
> actually modelling what you want to model. And that you are interpreting the 
> results correctly.  
> 
> Grüße, Martin
> 
>> On 06 Mar 2017, at 18:56, Bronwyn Overs > > wrote:
>> 
>> Hi Martin,
>> 
>> Thank you for your response, that is much clearer. 
>> 
>> I am also a little confused about how to specify the exact contrasts we wish 
>> to test and was hoping to get some advice. My design matrix X includes the 
>> following columns:
>> 1. Intercept
>> 2. Years from baseline
>> 3. Age at baseline
>> 4. Group (patients labelled 1, controls 0)
>> 5. Gender (females labelled 1, males 0)
>> 6. Col 2 (years) * Col 3 (age)
>> 7. Col 2 (years) * Col 4 (group)
>> 8. Col 3 (age) * Col 4 (group)
>> 9. Col 2 (years) * Col 3 (age) * Col 4 (group)
>> 
>> If I test the following contrast, is it giving me the effect of years across 
>> all groups and genders, or just years for male controls:
>> CM.C = [0 1 0 0 0 0 0 0 0]
>> 
>> Also, what contrast should I use to examine the effect of years in my 
>> patient group irrespective of gender?
>> 
>> Kind regards,
>> Bronwyn Overs
>> Research Assistant
>> 
>> Neuroscience Research Australia
>> Margarete Ainsworth Building
>> Barker Street Randwick Sydney NSW 2031 Australia
>> M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265
>> 
>> neura.edu.au  
>>   
>>  
>> 
>>> On 4 Mar 2017, at 12:43 am, Martin Reuter >> > wrote:
>>> 
>>> Hi Bronwyn, 
>>> 
>>> I think years-between-scans should be years-from-baseline-scans . You may 
>>> need to compute that if what you have is really years between neighbouring 
>>> scans.
>>> 
>>> 1. Usually people use intercept and maybe years-from-baseline as random 
>>> effects. I would not include too many random effects, as it each adds a lot 
>>> of free parameters and you need a lot of data to fit all that in a 
>>> meaningful way. Which of your columns are random effects can be passed 
>>> lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);
>>> for example has column 1 and 2 as random effects. 
>>> 
>>> 2. You can do a model comparison as described on our wiki 
>>> 

Re: [Freesurfer] LME mass univariate model

2017-03-07 Thread Martin Reuter
Hi Bronwyn, 

to shorten equations, lets set t = years_form_baseline
a = age
g = group
s = sex

so your model is
Y_ij = b0 + b1 t_ij + b2 a_i + b3 g_i + b4 s_i + b5 t_ij a_i + b6 t_ij g_i + b7 
a_i g_i + b8 t_ij a_i g_i
(as a fist step, I would consider simplifying it, by dropping the age 
interactions). 

Anyway

for male (s_i =0) and controls (g_i = 0) this reduces to
Y_ij = b0 + b1 t_ij + b2 a_i + b5 t_ij a_i 
so b1 is the slope for male controls, controlling for age and the slope age 
interaction. (0 1 0….)

Now for female (s=1) patients (g=1) we get this:

Y_ij = b0 + b1 t_ij + b2 a_i + b3  + b4 + b5 t_ij a_i + b6 t_ij + b7 a_i + b8 
t_ij
   = (b0+b3+b4) + (b1 + b6 + b8 ) t_ij + (b2+b7) a_i + b5 t_ij a_i 
So the slope for female patients (controlling for age and age time interaction) 
would be
(b1 + b6 + b8)
0 1 0 0 0 0 1 0 1

The difference in slope between female patients and male controls would be
0 0 0 0 0 0 1 0 1 (or the negative of that depending which way you subtract). 
Similarly you can look at group differences (controlling for age gender and 
interactions). 

Always write out the full model to make sure you understand what you are doing. 

To complete the picture, here is the contrast for the slope of male patients
0 1 0 0 0 0 1 0 1 (it is the same as for female patients, because you don’t 
have a timeXgender interaction. So that is your patient slope )
Therefore the 
0 0 0 0 0 0 1 0 1  is the slope difference between the groups. 

I would recommend you talk to a local biostatistician, to make sure you are 
actually modelling what you want to model. And that you are interpreting the 
results correctly.  

Grüße, Martin

> On 06 Mar 2017, at 18:56, Bronwyn Overs  wrote:
> 
> Hi Martin,
> 
> Thank you for your response, that is much clearer. 
> 
> I am also a little confused about how to specify the exact contrasts we wish 
> to test and was hoping to get some advice. My design matrix X includes the 
> following columns:
> 1. Intercept
> 2. Years from baseline
> 3. Age at baseline
> 4. Group (patients labelled 1, controls 0)
> 5. Gender (females labelled 1, males 0)
> 6. Col 2 (years) * Col 3 (age)
> 7. Col 2 (years) * Col 4 (group)
> 8. Col 3 (age) * Col 4 (group)
> 9. Col 2 (years) * Col 3 (age) * Col 4 (group)
> 
> If I test the following contrast, is it giving me the effect of years across 
> all groups and genders, or just years for male controls:
> CM.C = [0 1 0 0 0 0 0 0 0]
> 
> Also, what contrast should I use to examine the effect of years in my patient 
> group irrespective of gender?
> 
> Kind regards,
> Bronwyn Overs
> Research Assistant
> 
> Neuroscience Research Australia
> Margarete Ainsworth Building
> Barker Street Randwick Sydney NSW 2031 Australia
> M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265
> 
> neura.edu.au  
>   
>  
> 
>> On 4 Mar 2017, at 12:43 am, Martin Reuter > > wrote:
>> 
>> Hi Bronwyn, 
>> 
>> I think years-between-scans should be years-from-baseline-scans . You may 
>> need to compute that if what you have is really years between neighbouring 
>> scans.
>> 
>> 1. Usually people use intercept and maybe years-from-baseline as random 
>> effects. I would not include too many random effects, as it each adds a lot 
>> of free parameters and you need a lot of data to fit all that in a 
>> meaningful way. Which of your columns are random effects can be passed 
>> lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);
>> for example has column 1 and 2 as random effects. 
>> 
>> 2. You can do a model comparison as described on our wiki 
>> https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
>>  
>> 
>> You run the more complex model first (do the EM init and maybe RgGrow and 
>> RgW fit) and then the simple one (only the EMinit and  RgW fit) and do a 
>> likelihodd ratio test.  An example is on the above wiki.
>> 
>> Best ,Martin 
>> 
>> 
>> 
>> 
>> 
>>> On 27 Feb 2017, at 04:16, Bronwyn Overs >> > wrote:
>>> 
>>> Dear mailing list,
>>> 
>>> I am trying to run a LME model using the matlab tools, but I’m unsure how 
>>> to specify the model we wish to run. We have a qdec file that contains the 
>>> following columns:
>>> fsid, fsid-abse, years between scans, age at baseline, gender, group
>>> 
>>> We want to specify a model where we can examine four interaction terms 
>>> (years*age, years*group, age*group, years*age*group), as well as random 
>>> effects for the intercept, years and age. My questions are:
>>> 1. How do we specify a model that will include the random effects we want?
>>> 2. How do we compare our full model (3 random effects) with a model 
>>> excluding the random effect for age?

Re: [Freesurfer] LME mass univariate model

2017-03-06 Thread Bronwyn Overs
Hi Martin,

Thank you for your response, that is much clearer. 

I am also a little confused about how to specify the exact contrasts we wish to 
test and was hoping to get some advice. My design matrix X includes the 
following columns:
1. Intercept
2. Years from baseline
3. Age at baseline
4. Group (patients labelled 1, controls 0)
5. Gender (females labelled 1, males 0)
6. Col 2 (years) * Col 3 (age)
7. Col 2 (years) * Col 4 (group)
8. Col 3 (age) * Col 4 (group)
9. Col 2 (years) * Col 3 (age) * Col 4 (group)

If I test the following contrast, is it giving me the effect of years across 
all groups and genders, or just years for male controls:
CM.C = [0 1 0 0 0 0 0 0 0]

Also, what contrast should I use to examine the effect of years in my patient 
group irrespective of gender?

Kind regards,
Bronwyn Overs
Research Assistant

Neuroscience Research Australia
Margarete Ainsworth Building
Barker Street Randwick Sydney NSW 2031 Australia
M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265

neura.edu.au  
  
 

> On 4 Mar 2017, at 12:43 am, Martin Reuter  wrote:
> 
> Hi Bronwyn, 
> 
> I think years-between-scans should be years-from-baseline-scans . You may 
> need to compute that if what you have is really years between neighbouring 
> scans.
> 
> 1. Usually people use intercept and maybe years-from-baseline as random 
> effects. I would not include too many random effects, as it each adds a lot 
> of free parameters and you need a lot of data to fit all that in a meaningful 
> way. Which of your columns are random effects can be passed lme_fit_FS(X,[1 
> 2],Y(:,1)+Y(:,2),ni);
> for example has column 1 and 2 as random effects. 
> 
> 2. You can do a model comparison as described on our wiki 
> https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
>  
> 
> You run the more complex model first (do the EM init and maybe RgGrow and RgW 
> fit) and then the simple one (only the EMinit and  RgW fit) and do a 
> likelihodd ratio test.  An example is on the above wiki.
> 
> Best ,Martin 
> 
> 
> 
> 
> 
>> On 27 Feb 2017, at 04:16, Bronwyn Overs > > wrote:
>> 
>> Dear mailing list,
>> 
>> I am trying to run a LME model using the matlab tools, but I’m unsure how to 
>> specify the model we wish to run. We have a qdec file that contains the 
>> following columns:
>> fsid, fsid-abse, years between scans, age at baseline, gender, group
>> 
>> We want to specify a model where we can examine four interaction terms 
>> (years*age, years*group, age*group, years*age*group), as well as random 
>> effects for the intercept, years and age. My questions are:
>> 1. How do we specify a model that will include the random effects we want?
>> 2. How do we compare our full model (3 random effects) with a model 
>> excluding the random effect for age?
>> 
>> Kind regards,
>> Bronwyn Overs
>> Research Assistant
>> 
>> Neuroscience Research Australia
>> Margarete Ainsworth Building
>> Barker Street Randwick Sydney NSW 2031 Australia
>> M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265
>> 
>> neura.edu.au  
>>   
>>  
>> 
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu 
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu 
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer 
> 
> 
> 
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine 
> at
> http://www.partners.org/complianceline . If the e-mail was sent to you in 
> error
> but does not contain patient information, please contact the sender and 
> properly
> dispose of the e-mail.

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient 

Re: [Freesurfer] LME mass univariate model

2017-03-03 Thread Martin Reuter
Hi Bronwyn, 

I think years-between-scans should be years-from-baseline-scans . You may need 
to compute that if what you have is really years between neighbouring scans.

1. Usually people use intercept and maybe years-from-baseline as random 
effects. I would not include too many random effects, as it each adds a lot of 
free parameters and you need a lot of data to fit all that in a meaningful way. 
Which of your columns are random effects can be passed lme_fit_FS(X,[1 
2],Y(:,1)+Y(:,2),ni);
for example has column 1 and 2 as random effects. 

2. You can do a model comparison as described on our wiki 
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
 

You run the more complex model first (do the EM init and maybe RgGrow and RgW 
fit) and then the simple one (only the EMinit and  RgW fit) and do a likelihodd 
ratio test.  An example is on the above wiki.

Best ,Martin 





> On 27 Feb 2017, at 04:16, Bronwyn Overs  wrote:
> 
> Dear mailing list,
> 
> I am trying to run a LME model using the matlab tools, but I’m unsure how to 
> specify the model we wish to run. We have a qdec file that contains the 
> following columns:
> fsid, fsid-abse, years between scans, age at baseline, gender, group
> 
> We want to specify a model where we can examine four interaction terms 
> (years*age, years*group, age*group, years*age*group), as well as random 
> effects for the intercept, years and age. My questions are:
> 1. How do we specify a model that will include the random effects we want?
> 2. How do we compare our full model (3 random effects) with a model excluding 
> the random effect for age?
> 
> Kind regards,
> Bronwyn Overs
> Research Assistant
> 
> Neuroscience Research Australia
> Margarete Ainsworth Building
> Barker Street Randwick Sydney NSW 2031 Australia
> M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265
> 
> neura.edu.au  
>   
>  
> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME mass univariate model

2017-02-26 Thread Bronwyn Overs
Dear mailing list,

I am trying to run a LME model using the matlab tools, but I’m unsure how to 
specify the model we wish to run. We have a qdec file that contains the 
following columns:
fsid, fsid-abse, years between scans, age at baseline, gender, group

We want to specify a model where we can examine four interaction terms 
(years*age, years*group, age*group, years*age*group), as well as random effects 
for the intercept, years and age. My questions are:
1. How do we specify a model that will include the random effects we want?
2. How do we compare our full model (3 random effects) with a model excluding 
the random effect for age?

Kind regards,
Bronwyn Overs
Research Assistant

Neuroscience Research Australia
Margarete Ainsworth Building
Barker Street Randwick Sydney NSW 2031 Australia
M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265

neura.edu.au  
  
 

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME: contrast questions

2016-11-28 Thread jorge luis
Yes, it was arbitrary. A linear trajectory was a sufficiently good model for 
the mean response over time for most of the cortex points in my analyses. Also 
if you only have at most three time points per user then you can only have at 
most two random effects in your mixed-model (intercept and time). Time squared, 
if considered, would be just a fixed effect.
Best-Jorge


 
  De: Jordi Pegueroles 
 Para: jorge luis  
CC: Freesurfer 
 Enviado: Lunes 28 de noviembre de 2016 11:34
 Asunto: Re: LME: contrast questions
   
Thank you for your quickly answer Jorge.

What is the rule for decide if we have to use a quadratic term in the 
model? That is, in your example you use the 80% of the length of the 
lh.cortex as a threshold. Is this value an arbitrary one?

Thank you again,

A 2016-11-28 16:05, jorge luis escrigué:
> Hi Jordi
> 
> You have implicitly included the reference group in your statistical
> model by including an intercept term and a time variable:
> 
> group0 intercept: ß1
> group0 time: ß2
> group1 intercept: ß1+ß3
> group1 time: ß2+ß4
> group2 intercept: ß1+ß5
> group2 time: ß2+ß6
> 
> From here you can quickly see that your proposed contrast for the
>  differences in the mean response over time between group1 and group2
> is correct.
> 
> Finally the region growing estimation method should yield more
> precise (lower variance) estimates for the ßs but I think it’s (might
> be) too complicated to setup with the current scripts. The vw method
> will produce good estimates too. So I recommend the vw estimation
> method if things get too complicated for you with the region-wise
> method.
> 
> Cheers
> -Jorge
> 
>> -
>> DE: Jordi Pegueroles 
>> PARA: Freesurfer ; 
>> jbernal0...@yahoo.es
>> ENVIADO: Lunes 28 de noviembre de 2016 5:11
>> ASUNTO: LME: contrast questions
>> 
>> Dear FS experts,
>> 
>> I am trying to run a LME model for three groups (group0, group1 and
>> group2) and (almost all) with three time points, all processed using 
>> the
>> Longitudinal FS stream.
>> 
>> Our intention is to compare the differences between group0 against
>> group1 and group0 against group2. I have followed the online LME
>> tutorial and I have adapted your code to my data. However, I think I
>> have not well understood the steps and I have few questions that you
>> will be able to answer me...
>> 
>> i) In the X matrix I put the following columns:
>> 
>> 1) intercept
>> 2) time (years from baseline)
>> 3) group1 (binary variable: 1 if belongs to group1)
>> 4) group1.*time
>> 5) group2 (binary variable: 1 if belongs to group2)
>> 6) group2.*time
>> 
>> I don't understand why I do not have to include the reference group
>> (in my case group0 and group0.*time) in the design matrix. How I can 
>> see
>> the progresion of the reference group if I did not include it in the
>> design matrix? How I can compare both progressions if the time of the
>> group0 subjects is not taking into account?
>> 
>> ii) Linked to the previous question, if I want to compare the
>> differences in time between group1 and group2... Should the contrast 
>> be
>> C = [0 0 0 1 0 -1]?
>> 
>> iii) Finally, between the vw method and the region growing method 
>> which
>> one is more accurate? In other words, which one do you recommend to 
>> use?
>> 
>> Thank you,
>> 
>> --
>> Jordi.

-- 
Jordi.


   
 ___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME: contrast questions

2016-11-28 Thread jorge luis
 Hi Jordi

You have implicitlyincluded the reference group in your statistical model by 
includingan intercept term and a time variable:
group0 intercept: ß1group0 time: ß2group1 intercept:ß1+ß3group1 time: 
ß2+ß4group2 intercept:ß1+ß5group2 time: ß2+ß6

>From here you canquickly see that your proposed contrast for the 
differences inthe mean response over time between group1 and group2 is correct.
Finally the regiongrowing estimation method should yield more precise (lower 
variance)estimates for the ßs but I think it’s (might be) too complicatedto 
setup with the current scripts. The vw method will produce goodestimates too. 
So I recommend the vw estimation method if things gettoo complicated for you 
with the region-wise method.

Cheers-Jorge

 
  De: Jordi Pegueroles 
 Para: Freesurfer ; jbernal0...@yahoo.es 
 Enviado: Lunes 28 de noviembre de 2016 5:11
 Asunto: LME: contrast questions
   
Dear FS experts,

I am trying to run a LME model for three groups (group0, group1 and 
group2) and (almost all) with three time points, all processed using the 
Longitudinal FS stream.

Our intention is to compare the differences between group0 against 
group1 and group0 against group2. I have followed the online LME 
tutorial and I have adapted your code to my data. However, I think I 
have not well understood the steps and I have few questions that you 
will be able to answer me...

i) In the X matrix I put the following columns:

    1)  intercept
    2) time (years from baseline)
    3) group1 (binary variable: 1 if belongs to group1)
    4) group1.*time
    5) group2 (binary variable: 1 if belongs to group2)
    6) group2.*time

    I don't understand why I do not have to include the reference group 
(in my case group0 and group0.*time) in the design matrix. How I can see 
the progresion of the reference group if I did not include it in the 
design matrix? How I can compare both progressions if the time of the 
group0 subjects is not taking into account?

ii) Linked to the previous question, if I want to compare the 
differences in time between group1 and group2... Should the contrast be 
C = [0 0 0 1 0 -1]?

iii) Finally, between the vw method and the region growing method which 
one is more accurate? In other words, which one do you recommend to use?

Thank you,

-- 
Jordi.


   
 ___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME contrast 3 groups

2016-08-19 Thread Sarah Hirsiger
Dear FreeSurfer experts,

 I would appreciate a confirmation regarding correctness of my approach.


I am trying to run an LME model for three groups (group1=controls, group2 and 
group3) and two time points.

I followed the tutorial on 
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 

and adapted the four group example. However, I am not 100% sure if my adaption 
is correct and would appreciate your input.

 

The design matrix for the model contains the following columns:

 

1)   Intercept

2)   time (tij)

3)   one for Group2 and zero otherwise

4)   column 3) .* time

5)   one for Group3 and zero otherwise 

6)   column 5) .* time

 

To test the null hypothesis of no group differences in the rate of change over 
time among the three groups I applied the following contrast:

 0 0 0 1 0 0

 0 0 0-1 0 1  

Is this contrast correct?

In a second step, I would use the additional three contrasts to identify which 
groups were different:

0 0 0 1 0 0   and 0 0 0 0 0 1 and 0 0 0 -1 0 0 1

 

I really appreciate your help!

Best wishes



Sarah


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME for surface area

2016-07-25 Thread Clara Kühn
Dear FreeSurfer Experts,

I'm following the LME tutorial to analyze my data. The example that is given in 
the tutorial is for a left hemispheric cortical thickness analysis. I would 
also like to look at surface area. Would I follow the same steps? At the point 
in the tutorial that uses the lme_mass_fit_Rgw command I have to specify a 
Distance type (euc or surf). How would I do that regarding surface area? Would 
I have to skip this step or is there a similar command or does it just work 
with different arguments? Unfortunately, surface area isn't mentioned in LME 
tutorial.

Thanks for your help!
Clara

-- 
Clara Kühn, Phd Student
 
Max-Planck-Institute for Human Cognitive and Brain Science
Department of Neuropsychology
Stephanstrasse 1A
04103 Leipzig, Germany

Phone: +49 341 - 9940 2271
Fax: +49 341 - 9940 2260
Web: www.cbs.mpg.de
E-Mail: cku...@cbs.mpg.de

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME contrasts

2016-07-18 Thread Clara Kühn
Dear FreeSurfer experts,

I am following the mass-univariate (spatiotemporal) model in the LME tutorial. 
My design matrix X has the following columns:
intercept, time, time², group1, group1*time, group1*time², group2, group2*time, 
group2*time², sex, age, mean_thickness

I actually have 3 groups but group1 and group2 in X are dummy coded.

I would like to check whether there are group differences in the quadratic term 
but I don't understand what this command expresses and how the contrast was 
formed:

CM.C = [zeros(3,5) [1 0 0 0 0 0 0;-1 0 0 1 0 0 0;0 0 0 -1 0 0 1] zeros(3,5)];

Could you please explain it on the example design matrix so I can adapt it to 
mine?

Thank you!
Clara

-- 
Clara Kühn, Phd Student
 
Max-Planck-Institute for Human Cognitive and Brain Science
Department of Neuropsychology
Stephanstrasse 1A
04103 Leipzig, Germany

Phone: +49 341 - 9940 2271
Fax: +49 341 - 9940 2260
Web: www.cbs.mpg.de
E-Mail: cku...@cbs.mpg.de

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME MATLAB, X matrix error

2016-05-26 Thread Hanbyul Cho
Dear Martin Reuter,

Thank you for your clear explanation.

Best wishes,

Han.

On Tue, May 24, 2016 at 12:41 PM, Martin Reuter  wrote:

> Dear Han,
>
> if controls have only 1 time point, you cannot compare/analyse any
> measurement of change across the groups (such as atrophy rates). You can
> only do a cross sectional analysis at baseline.
> For patients you could separately look at atrophy rates (if they differ
> from zero, which should be true for any type of group - so that alone is
> not very exciting).
> Usually there is only one time column with time-from-baseline for example
>
> me1 0 ...
> me2 1.2 ...
> me 3 1.8 ...
> you1 0 ..
> you2 0.9 ...
> he1 0
> she1 0
> she2 1.1
> and so on (this could be in years). There can be differently many rows per
> subject, depending on the number of time points. Single time point
> subjects, can be mixed in and will help to estimate cross subject
> variances, but they won't really help much with estimates of longitudinal
> changes. Having a full group with only a single time point does not make
> sense in a longitudinal design.
>
> Best, Martin
>
>
>
> On 05/21/2016 06:42 PM, Hanbyul Cho wrote:
>
> Dear Martin Reuter,
>
> Thank you for your reply.
>
> Our patients have several time points, but controls have only 1 time
> points,
> so when I coded the patients group =1, controls groups = 0 ,
> the 2. time  and  3. time2 column were same as 5. 4.X time 6. 4.X time2
> column.
> and 8. 7. X time and 9. 8. X time2 were all zeros.
>
> And then, how about this X matrix (Subjects N X 5)?
>
> 1. Intercept (all '1')
> 2. 4.X time (from baseline time point)
> 3. 4.X time2
> 4. age
> 5. extra values for covariate
>
> is it a vallid matrix for test the effects of group X time2 ?
>
>
> Thank you,
>
> Han.
>
> On Sat, May 21, 2016 at 3:13 PM, Martin Reuter <
> mreu...@nmr.mgh.harvard.edu> wrote:
>
>> Hi Han,
>> Try to find a local statistician to help you with your analysis.
>> About your matrix: rows need to be number of all time points from all
>> subject. Time 2 should probably not be there. Also columns 7-9 need to be
>> dropped (they are just the negative of the rows before).
>>
>> Best Martin
>> On May 21, 2016 3:32 PM, Hanbyul Cho  wrote:
>>
>> Dear FreeSurfer Team,
>>
>> I processed in MATLAB for Linear Mixed Effects Models Analysis with this
>> X matrix:
>>
>> X matrix is 'Subjects N X 11', 11 columns are as follow,
>>
>> 1. Intercept (all '1')
>> 2. time (from baseline time point)
>> 3. time2
>> 4. Patients group = 1, Control = 0
>> 5. 4.X time
>> 6. 4.X time2
>> 7. Patients group = 0, Control = 1
>> 8. 7. X time
>> 9. 8. X time2
>> 10. age
>> 11. extra values for covariate
>>
>>
>> 1.
>> When I process this command,
>> [lhTh01,lhRe01] = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3,4)
>> The MATLAB windows print the warning alarm repeatedly.
>> " Warning: Matrix is close to singular or badly scaled. Results may be
>> inaccurate."
>> Is this X matrix something wrong?
>>
>>
>> 2.
>> After complete   'lme_mass_fit_EMinit' process with the warning, I tried
>> the next command,
>> [lhRgs01,lhRgMeans01] = lme_mass_RgGrow(lhsphere, lhRe01,
>> lhTh01,lhcortex,2,95);
>> This command took a long time to process, and it caused the whole stop
>> MATLAB works.
>> Is it also because of the X matrix...?
>>
>>
>> Could you let me know the solution for the X matrix problems ?
>>
>> Best Wishes,
>>
>> Han
>>
>>
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
>> The information in this e-mail is intended only for the person to whom it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>> in error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>
>
> ___
> Freesurfer mailing 
> listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> --
> Martin Reuter, PhD
> Assistant Professor of Radiology, Harvard Medical School
> Assistant Professor of Neurology, Harvard Medical School
> A.A.Martinos Center for Biomedical Imaging
> Massachusetts General Hospital
> Research Affiliate, CSAIL, MIT
> Phone: +1-617-724-5652
> Web  : http://reuter.mit.edu
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> 

Re: [Freesurfer] LME MATLAB, X matrix error

2016-05-24 Thread Martin Reuter

Dear Han,

if controls have only 1 time point, you cannot compare/analyse any 
measurement of change across the groups (such as atrophy rates). You can 
only do a cross sectional analysis at baseline.
For patients you could separately look at atrophy rates (if they differ 
from zero, which should be true for any type of group - so that alone is 
not very exciting).

Usually there is only one time column with time-from-baseline for example

me1 0 ...
me2 1.2 ...
me 3 1.8 ...
you1 0 ..
you2 0.9 ...
he1 0
she1 0
she2 1.1
and so on (this could be in years). There can be differently many rows 
per subject, depending on the number of time points. Single time point 
subjects, can be mixed in and will help to estimate cross subject 
variances, but they won't really help much with estimates of 
longitudinal changes. Having a full group with only a single time point 
does not make sense in a longitudinal design.


Best, Martin


On 05/21/2016 06:42 PM, Hanbyul Cho wrote:

Dear Martin Reuter,

Thank you for your reply.

Our patients have several time points, but controls have only 1 time 
points,

so when I coded the patients group =1, controls groups = 0 ,
the 2. time  and  3. time2 column were same as 5. 4.X time 6. 4.X 
time2 column.

and 8. 7. X time and 9. 8. X time2 were all zeros.

And then, how about this X matrix (Subjects N X 5)?

1. Intercept (all '1')
2. 4.X time (from baseline time point)
3. 4.X time2
4. age
5. extra values for covariate

is it a vallid matrix for test the effects of group X time2 ?


Thank you,

Han.

On Sat, May 21, 2016 at 3:13 PM, Martin Reuter 
> wrote:


Hi Han,
Try to find a local statistician to help you with your analysis.
About your matrix: rows need to be number of all time points from
all subject. Time 2 should probably not be there. Also columns 7-9
need to be dropped (they are just the negative of the rows before).

Best Martin

On May 21, 2016 3:32 PM, Hanbyul Cho > wrote:

Dear FreeSurfer Team,

I processed in MATLAB for Linear Mixed Effects Models Analysis
with this X matrix:

X matrix is 'Subjects N X 11', 11 columns are as follow,

1. Intercept (all '1')
2. time (from baseline time point)
3. time2
4. Patients group = 1, Control = 0
5. 4.X time
6. 4.X time2
7. Patients group = 0, Control = 1
8. 7. X time
9. 8. X time2
10. age
11. extra values for covariate


1.
When I process this command,
[lhTh01,lhRe01] = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3,4)
The MATLAB windows print the warning alarm repeatedly.
" Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate."
Is this X matrix something wrong?


2.
After complete   'lme_mass_fit_EMinit' process with the
warning, I tried the next command,
[lhRgs01,lhRgMeans01] = lme_mass_RgGrow(lhsphere, lhRe01,
lhTh01,lhcortex,2,95);
This command took a long time to process, and it caused
the whole stop MATLAB works.
Is it also because of the X matrix...?


Could you let me know the solution for the X matrix problems ?

Best Wishes,

Han


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu 
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to
whom it is
addressed. If you believe this e-mail was sent to you in error and
the e-mail
contains patient information, please contact the Partners
Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to
you in error
but does not contain patient information, please contact the
sender and properly
dispose of the e-mail.




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


--
Martin Reuter, PhD
Assistant Professor of Radiology, Harvard Medical School
Assistant Professor of Neurology, Harvard Medical School
A.A.Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Research Affiliate, CSAIL, MIT
Phone: +1-617-724-5652
Web  : http://reuter.mit.edu

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at

Re: [Freesurfer] LME MATLAB, X matrix error

2016-05-21 Thread Hanbyul Cho
Dear Martin Reuter,

Thank you for your reply.

Our patients have several time points, but controls have only 1 time points,
so when I coded the patients group =1, controls groups = 0 ,
the 2. time  and  3. time2 column were same as 5. 4.X time 6. 4.X time2
column.
and 8. 7. X time and 9. 8. X time2 were all zeros.

And then, how about this X matrix (Subjects N X 5)?

1. Intercept (all '1')
2. 4.X time (from baseline time point)
3. 4.X time2
4. age
5. extra values for covariate

is it a vallid matrix for test the effects of group X time2 ?


Thank you,

Han.

On Sat, May 21, 2016 at 3:13 PM, Martin Reuter 
wrote:

> Hi Han,
> Try to find a local statistician to help you with your analysis.
> About your matrix: rows need to be number of all time points from all
> subject. Time 2 should probably not be there. Also columns 7-9 need to be
> dropped (they are just the negative of the rows before).
>
> Best Martin
> On May 21, 2016 3:32 PM, Hanbyul Cho  wrote:
>
> Dear FreeSurfer Team,
>
> I processed in MATLAB for Linear Mixed Effects Models Analysis with this X
> matrix:
>
> X matrix is 'Subjects N X 11', 11 columns are as follow,
>
> 1. Intercept (all '1')
> 2. time (from baseline time point)
> 3. time2
> 4. Patients group = 1, Control = 0
> 5. 4.X time
> 6. 4.X time2
> 7. Patients group = 0, Control = 1
> 8. 7. X time
> 9. 8. X time2
> 10. age
> 11. extra values for covariate
>
>
> 1.
> When I process this command,
> [lhTh01,lhRe01] = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3,4)
> The MATLAB windows print the warning alarm repeatedly.
> " Warning: Matrix is close to singular or badly scaled. Results may be
> inaccurate."
> Is this X matrix something wrong?
>
>
> 2.
> After complete   'lme_mass_fit_EMinit' process with the warning, I tried
> the next command,
> [lhRgs01,lhRgMeans01] = lme_mass_RgGrow(lhsphere, lhRe01,
> lhTh01,lhcortex,2,95);
> This command took a long time to process, and it caused the whole stop
> MATLAB works.
> Is it also because of the X matrix...?
>
>
> Could you let me know the solution for the X matrix problems ?
>
> Best Wishes,
>
> Han
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME MATLAB, X matrix error

2016-05-21 Thread Martin Reuter
Hi Han,
Try to find a local statistician to help you with your analysis. 
About your matrix: rows need to be number of all time points from all subject. Time 2 should probably not be there. Also columns 7-9 need to be dropped (they are just the negative of the rows before). 
Best Martin
On May 21, 2016 3:32 PM, Hanbyul Cho  wrote:Dear FreeSurfer Team,I processed in MATLAB for Linear Mixed Effects Models Analysis with this X matrix:X matrix is 'Subjects N X 11', 11 columns are as follow,1. Intercept (all '1')2. time (from baseline time point)3. time24. Patients group = 1, Control = 05. 4.X time6. 4.X time27. Patients group = 0, Control = 18. 7. X time9. 8. X time210. age11. extra values for covariate1. When I process this command, [lhTh01,lhRe01] = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3,4)The MATLAB windows print the warning alarm repeatedly." Warning: Matrix is close to singular or badly scaled. Results may be inaccurate."Is this X matrix something wrong?2.After complete   'lme_mass_fit_EMinit' process with the warning, I tried the next command,[lhRgs01,lhRgMeans01] = lme_mass_RgGrow(lhsphere, lhRe01, lhTh01,lhcortex,2,95);This command took a long time to process, and it caused the whole stop MATLAB works.Is it also because of the X matrix...?Could you let me know the solution for the X matrix problems ?Best Wishes,Han
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] LME MATLAB, X matrix error

2016-05-21 Thread Hanbyul Cho
Dear FreeSurfer Team,

I processed in MATLAB for Linear Mixed Effects Models Analysis with this X
matrix:

X matrix is 'Subjects N X 11', 11 columns are as follow,

1. Intercept (all '1')
2. time (from baseline time point)
3. time2
4. Patients group = 1, Control = 0
5. 4.X time
6. 4.X time2
7. Patients group = 0, Control = 1
8. 7. X time
9. 8. X time2
10. age
11. extra values for covariate


1.
When I process this command,
[lhTh01,lhRe01] = lme_mass_fit_EMinit(X,[1],Y,ni,lhcortex,3,4)
The MATLAB windows print the warning alarm repeatedly.
" Warning: Matrix is close to singular or badly scaled. Results may be
inaccurate."
Is this X matrix something wrong?


2.
After complete   'lme_mass_fit_EMinit' process with the warning, I tried
the next command,
[lhRgs01,lhRgMeans01] = lme_mass_RgGrow(lhsphere, lhRe01,
lhTh01,lhcortex,2,95);
This command took a long time to process, and it caused the whole stop
MATLAB works.
Is it also because of the X matrix...?


Could you let me know the solution for the X matrix problems ?

Best Wishes,

Han
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME parpool matlabpool update

2016-05-09 Thread Martin Reuter

Hi Sean,

thanks for sharing. Our dev version already has an update for parpool 
(falling back to matlabpool to support older matlab versions). Also some 
code to detect the parallel toolbox and run single thread when it is not 
available. We merged those updates back via a pull request into Jorge's 
github version a few weeks ago.


Best, Martin

On 05/09/2016 01:23 PM, Seán Froudist Walsh wrote:

Hey,

Not sure if this could save someone else the trouble. The LME fitting 
software wasn't working for me since I updated Matlab, which has now 
switched from matlabpool to parpool for parallel processing, so I 
switched the call in the scripts to parpool, which seems to be working 
fine.


Please find the updated scripts attached, for anyone interested.

Best wishes,

Sean

Sean Froudist-Walsh
Postdoctoral Fellow
Friedman Brain Institute
Icahn School of Medicine at Mount Sinai


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


--
Martin Reuter, PhD
Assistant Professor of Radiology, Harvard Medical School
Assistant Professor of Neurology, Harvard Medical School
A.A.Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Research Affiliate, CSAIL, MIT
Phone: +1-617-724-5652
Web  : http://reuter.mit.edu

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] Lme and random effect

2016-04-29 Thread Patrizia Dall'Acqua

































Dear
FS-Group

 

I use the lme matlab tools for my
longitudinal analysis and everything works fine.  

My dataset consists of 2 time-points
and 2 groups (patients and controls) and my design matrix X contains 4 columns
(1. intercept, 2. time, 3. group, 4. interaction group*time).

As suggested from the mailing list
archive, I used the intercept as the random effect since I have only 2 time
points and I found some interesting results. 



However, I still don’t understand
why I should choose the intercept for my model and not for example the time or
the interaction as the random effect.

 

THANK you for any help!

 

All best wishes, 



Patrizia





  ___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] lme model for within-subjects repeated measures design

2016-04-21 Thread Martin Reuter

Thanks,

what I mean is in order to quantify a treatment effect for the subjects 
that received treatment at T0, you would need another scan before that 
(Tminus1). You would need three time points:


group1: baseline, placebo, treatment
group2: baseline, treatment, placebo

you could then test if treatment or placebo differs from baseline.

If you assume that the ordering is not important, you could use a binary 
variable (drug / placebo) instead of time in LME and control for the 
time delta as a co-variate. This may make sense, as you are not really 
interested in change / time unit.


Another model would be to use time as usual in LME and add drug as a 
time varying covariate. I am not a statistician, so I don't really know 
what would be best in your case.


Cheers, Martin



On 04/21/2016 06:08 PM, Martina Papmeyer wrote:

Hi Martin

Thank you very much for your response!  To clarify the design: There 
are 44 subjects, all have been scanned twice and thus have repeated 
measures of cortical thickness. 22 subjects were first (T0) scanned 2 
hours after a placebo treatment. Some days later, the identical 
subjects were scanned again (T1) but this time 2 hours after a "real" 
treatment. The other 22 subjects were scanned first (T0) after "real" 
treatment and then some days later after placebo treatment. The 
interval between T0 and T1 varies between subjects which I would like 
to take into account into my analyses. The time between receiving 
placebo/real treatment and MRI acquisition is identical among all 
subjects (2hours) and thus not of concern.


Thank you very much for your help! Best, Martina

Sent from my iPad

On 21 Apr 2016, at 22:09, Martin Reuter > wrote:



Hi Martina,

so you don't have a baseline (no treatment) measurement? If you have 
a treatment at T0, you mean during an interval before T0, right? But 
since you did not scan before that treatment, you cannot quantify 
that change? The design is not clear to me.


About the random effect (with only two time points and two groups) I 
think having the intercept is enough.


Best, Martin


On 04/18/2016 11:51 AM, martina.papme...@puk.unibe.ch wrote:


Dear FreeSurfer experts

I have one question regarding my data analysis and would be 
extremely thankful for any advice!


My data-set is as follows: I have repeated measures (time point 0 
(T0), time point 1 (T1)) of several subjects. All individuals 
underwent an intervention at one of the time points and a placebo 
condition at the other time point in a fully randomized fashion. 
Thus, half of the subjects received treatment at T0 and half of them 
at T1. I am interested in the putative effect of the intervention on 
cortical thickness in a ROI. A major challenge is that the time 
between T0 and T1 varies between individuals and that I expect the 
time to impact on my dependent variable and to likely interact with 
the condition (treatment versus placebo).


I thought about conducting a simple repeated-measures ANOVA. 
However, as stated, I want to take the time between the two sessions 
into account. I also thought about an analysis of rates or percent 
changes. However, this approach does not model the correlation among 
the repeated measures and is thus associated with a reduction in power.


Accordingly, I am trying to use lme models to analyse my data. Since 
I have no between-group variable but a within-subjects design, I am 
concerned if my thoughts are correct and would be grateful for feedback.


I ran the longitudinal FS stream and followed the longitudinal lme 
model tutorial. I propose the following lme model with one random 
factor: thickness = intercept (random factor) + time since baseline 
+ ICV + condition (placebo or treatment) + timeXcondition + Age 
(does not change across time interval) + gender


The analysis finishes with 0% non-covergence. Can you tell me if my 
model is suitable given the fact that it is a within-subjects 
design? I also started wondering if it was possible to model time as 
a random factor but I think that I read that this is not suitable if 
you only have two groups (in my case: conditions).


Thank you very much for help and advice!

All best wishes, Martina

Universitäre Psychiatrische Dienste Bern (UPD)
*Universitätsklinik für Psychiatrie und Psychotherapie*
Systemische Neurowissenschaften der Psychopathologie
Zentrum für Translationale Forschung
Dr. phil. Martina Papmeyer, Wissenschaftliche Mitarbeiterin
Bolligenstrasse 111, CH-3000 Bern 60
Tel: ++41 0(31) 930 9599, Fax: ++41 0(31) 930 9961
Mail: martina.papme...@puk.unibe.ch
www.puk.unibe.ch



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


--
Martin Reuter, PhD
Assistant Professor of Radiology, Harvard Medical School
Assistant Professor of Neurology, Harvard Medical School
A.A.Martinos Center for 

Re: [Freesurfer] lme model for within-subjects repeated measures design

2016-04-21 Thread Martina Papmeyer
Hi Martin 

Thank you very much for your response!  To clarify the design: There are 44 
subjects, all have been scanned twice and thus have repeated measures of 
cortical thickness. 22 subjects were first (T0) scanned 2 hours after a placebo 
treatment. Some days later, the identical subjects were scanned again (T1) but 
this time 2 hours after a "real" treatment. The other 22 subjects were scanned 
first (T0) after "real" treatment and then some days later after placebo 
treatment. The interval between T0 and T1 varies between subjects which I would 
like to take into account into my analyses. The time between receiving 
placebo/real treatment and MRI acquisition is identical among all subjects 
(2hours) and thus not of concern. 

Thank you very much for your help! Best, Martina 

Sent from my iPad

> On 21 Apr 2016, at 22:09, Martin Reuter  wrote:
> 
> Hi Martina,
> 
> so you don't have a baseline (no treatment) measurement? If you have a 
> treatment at T0, you mean during an interval before T0, right? But since you 
> did not scan before that treatment, you cannot quantify that change? The 
> design is not clear to me.
> 
> About the random effect (with only two time points and two groups) I think 
> having the intercept is enough.
> 
> Best, Martin
> 
> 
>> On 04/18/2016 11:51 AM, martina.papme...@puk.unibe.ch wrote:
>> Dear FreeSurfer experts
>>  
>> I have one question regarding my data analysis and would be extremely 
>> thankful for any advice!
>>  
>> My data-set is as follows: I have repeated measures (time point 0 (T0), time 
>> point 1 (T1)) of several subjects. All individuals underwent an intervention 
>> at one of the time points and a placebo condition at the other time point in 
>> a fully randomized fashion. Thus, half of the subjects received treatment at 
>> T0 and half of them at T1. I am interested in the putative effect of the 
>> intervention on cortical thickness in a ROI. A major challenge is that the 
>> time between T0 and T1 varies between individuals and that I expect the time 
>> to impact on my dependent variable and to likely interact with the condition 
>> (treatment versus placebo).
>>  
>> I thought about conducting a simple repeated-measures ANOVA. However, as 
>> stated, I want to take the time between the two sessions into account. I 
>> also thought about an analysis of rates or percent changes. However, this 
>> approach does not model the correlation among the repeated measures and is 
>> thus associated with a reduction in power.
>>  
>> Accordingly, I am trying to use lme models to analyse my data. Since I have 
>> no between-group variable but a within-subjects design, I am concerned if my 
>> thoughts are correct and would be grateful for feedback.
>>  
>> I ran the longitudinal FS stream and followed the longitudinal lme model 
>> tutorial. I propose the following lme model with one random factor: 
>> thickness = intercept (random factor) + time since baseline + ICV + 
>> condition (placebo or treatment) + timeXcondition + Age (does not change 
>> across time interval) + gender
>>  
>> The analysis finishes with 0% non-covergence. Can you tell me if my model is 
>> suitable given the fact that it is a within-subjects design? I also started 
>> wondering if it was possible to model time as a random factor but I think 
>> that I read that this is not suitable if you only have two groups (in my 
>> case: conditions).
>>  
>> Thank you very much for help and advice!
>>  
>> All best wishes, Martina
>>  
>>  
>>  
>>  
>> Universitäre Psychiatrische Dienste Bern (UPD)
>> Universitätsklinik für Psychiatrie und Psychotherapie
>> Systemische Neurowissenschaften der Psychopathologie
>> Zentrum für Translationale Forschung
>> Dr. phil. Martina Papmeyer, Wissenschaftliche Mitarbeiterin
>> Bolligenstrasse 111, CH-3000 Bern 60
>> Tel: ++41 0(31) 930 9599, Fax: ++41 0(31) 930 9961
>> Mail: martina.papme...@puk.unibe.ch 
>> www.puk.unibe.ch
>>  
>>  
>> 
>> 
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> -- 
> Martin Reuter, PhD
> Assistant Professor of Radiology, Harvard Medical School
> Assistant Professor of Neurology, Harvard Medical School
> A.A.Martinos Center for Biomedical Imaging
> Massachusetts General Hospital
> Research Affiliate, CSAIL, MIT
> Phone: +1-617-724-5652
> Web  : http://reuter.mit.edu 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> 
> 
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine 
> at
> http://www.partners.org/complianceline . If the e-mail was sent to you in 
> error
> 

Re: [Freesurfer] lme model for within-subjects repeated measures design

2016-04-21 Thread Martin Reuter

Hi Martina,

so you don't have a baseline (no treatment) measurement? If you have a 
treatment at T0, you mean during an interval before T0, right? But since 
you did not scan before that treatment, you cannot quantify that change? 
The design is not clear to me.


About the random effect (with only two time points and two groups) I 
think having the intercept is enough.


Best, Martin


On 04/18/2016 11:51 AM, martina.papme...@puk.unibe.ch wrote:


Dear FreeSurfer experts

I have one question regarding my data analysis and would be extremely 
thankful for any advice!


My data-set is as follows: I have repeated measures (time point 0 
(T0), time point 1 (T1)) of several subjects. All individuals 
underwent an intervention at one of the time points and a placebo 
condition at the other time point in a fully randomized fashion. Thus, 
half of the subjects received treatment at T0 and half of them at T1. 
I am interested in the putative effect of the intervention on cortical 
thickness in a ROI. A major challenge is that the time between T0 and 
T1 varies between individuals and that I expect the time to impact on 
my dependent variable and to likely interact with the condition 
(treatment versus placebo).


I thought about conducting a simple repeated-measures ANOVA. However, 
as stated, I want to take the time between the two sessions into 
account. I also thought about an analysis of rates or percent changes. 
However, this approach does not model the correlation among the 
repeated measures and is thus associated with a reduction in power.


Accordingly, I am trying to use lme models to analyse my data. Since I 
have no between-group variable but a within-subjects design, I am 
concerned if my thoughts are correct and would be grateful for feedback.


I ran the longitudinal FS stream and followed the longitudinal lme 
model tutorial. I propose the following lme model with one random 
factor: thickness = intercept (random factor) + time since baseline + 
ICV + condition (placebo or treatment) + timeXcondition + Age (does 
not change across time interval) + gender


The analysis finishes with 0% non-covergence. Can you tell me if my 
model is suitable given the fact that it is a within-subjects design? 
I also started wondering if it was possible to model time as a random 
factor but I think that I read that this is not suitable if you only 
have two groups (in my case: conditions).


Thank you very much for help and advice!

All best wishes, Martina

Universitäre Psychiatrische Dienste Bern (UPD)
*Universitätsklinik für Psychiatrie und Psychotherapie*
Systemische Neurowissenschaften der Psychopathologie
Zentrum für Translationale Forschung
Dr. phil. Martina Papmeyer, Wissenschaftliche Mitarbeiterin
Bolligenstrasse 111, CH-3000 Bern 60
Tel: ++41 0(31) 930 9599, Fax: ++41 0(31) 930 9961
Mail: martina.papme...@puk.unibe.ch
www.puk.unibe.ch



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


--
Martin Reuter, PhD
Assistant Professor of Radiology, Harvard Medical School
Assistant Professor of Neurology, Harvard Medical School
A.A.Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Research Affiliate, CSAIL, MIT
Phone: +1-617-724-5652
Web  : http://reuter.mit.edu

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] Lme matlab tools lhstats

2016-04-20 Thread Martin Reuter

Hi Patrizia,

Usually you would allow the intercept to be a random effect (1st 
column). Basically random effect means, you allow each subject to have 
their own intercept, which usually makes sense. That could be sufficient 
for your model, you can also test if having two random effects is better 
(including the time slope, so the second column). This allows also the 
individual slopes to be different from each other. It is usually a good 
idea to keep the number of random effects small.


Best, Martin

On 04/20/2016 06:49 AM, Patrizia Dall'Acqua wrote:


Dear FS-Group

I am attempting to use the lme matlab tools for my longitudinal analysis.

My dataset consists of 2 time-points and 2 groups (patients and 
controls). I will not use covariates since the groups are well matched 
for age, gender and education.


I am trying to adapt the wiki instructions of the mass-univariate 
model to our data.


Our design matrix X contains 4 columns:

1. intercept

2. time

3. group

4. interaction group*time

Our Cmd history:

[Y,mri] = fs_read_Y('lh.thickness_sm15.mgh');

lhsphere = 
fs_read_surf('/subjects/average_LTHV_long_all_49/surf/lh.sphere');


lhcortex = 
fs_read_label('/subjects/average_LTHV_long_all_49/label/lh.cortex.label');


Qdec = fReadQdec('qdec.long.table_4columns.txt');

Qdec = rmQdecCol(Qdec,1);

sID = Qdec(2:end,1);

Qdec = rmQdecCol(Qdec,1);

M = Qdec2num(Qdec);

[M,Y,ni] = sortData(M,1,Y,sID);

X = [ones(length(M),1) M M(:,1).*M(:,2)];

lhstats = lme_mass_fit_vw(X, [4], Y, ni, lhcortex)

I am mainly interested in comparing longitudinal changes between 
groups (group*time interaction) but also interested in the main effect 
of group and time.


I have two questions:

1. I am not sure about my „interpretation“ of random and fixed 
effect.Since I am interested in the group*time interaction (4. 
column), does it make sense to use a single random effect for this 
interaction or should I take a second random effect for time (2. column)?


2. If a model with two random effects make sense (2. and 4. column), 
should I compare the model including two random effects with a model 
with a singlerandom effect to test which one is significantly better?


Thank you for your help!


Patrizia



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


--
Martin Reuter, PhD
Assistant Professor of Radiology, Harvard Medical School
Assistant Professor of Neurology, Harvard Medical School
A.A.Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Research Affiliate, CSAIL, MIT
Phone: +1-617-724-5652
Web  : http://reuter.mit.edu

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] Lme matlab tools lhstats

2016-04-20 Thread Patrizia Dall'Acqua




















Dear FS-Group

 

I am attempting to use the lme matlab tools
for my longitudinal analysis.

My dataset consists of 2 time-points and 2
groups (patients and controls). I will not use covariates since the groups are
well matched for age, gender and education.

 

I am trying to adapt the wiki instructions of
the mass-univariate model to our data.

 

Our design matrix X contains 4 columns:

1. intercept

2. time

3. group

4. interaction group*time

 

Our Cmd history:

 

[Y,mri] = fs_read_Y('lh.thickness_sm15.mgh');

 

lhsphere =
fs_read_surf('/subjects/average_LTHV_long_all_49/surf/lh.sphere'); 

 

lhcortex =
fs_read_label('/subjects/average_LTHV_long_all_49/label/lh.cortex.label');

 

Qdec = fReadQdec('qdec.long.table_4columns.txt');

 

Qdec = rmQdecCol(Qdec,1);  

 

sID = Qdec(2:end,1);   

 

Qdec = rmQdecCol(Qdec,1);  

 

M = Qdec2num(Qdec);  

 

[M,Y,ni] = sortData(M,1,Y,sID);  

 

X = [ones(length(M),1) M M(:,1).*M(:,2)];

 

lhstats = lme_mass_fit_vw(X, [4], Y, ni, lhcortex)

 

 

I am mainly interested in comparing
longitudinal changes between groups (group*time interaction) but also
interested in the main effect of group and time. 

 

I have two questions:

 

1. I am not sure about my „interpretation“ of
random and fixed effect. Since I am interested in the group*time
interaction (4. column), does it make sense to use a single random effect for
this interaction or should I take a second random effect for time (2. column)? 

 

2. If a model with two random effects make
sense (2. and 4. column), should I compare the model  including two random
effects with a model with a single random effect to test which one is 
significantly better? 

 

Thank you for your help!

Patrizia





  ___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] lme model for within-subjects repeated measures design

2016-04-18 Thread martina.papmeyer
Dear FreeSurfer experts



I have one question regarding my data analysis and would be extremely thankful 
for any advice!



My data-set is as follows: I have repeated measures (time point 0 (T0), time 
point 1 (T1)) of several subjects. All individuals underwent an intervention at 
one of the time points and a placebo condition at the other time point in a 
fully randomized fashion. Thus, half of the subjects received treatment at T0 
and half of them at T1. I am interested in the putative effect of the 
intervention on cortical thickness in a ROI. A major challenge is that the time 
between T0 and T1 varies between individuals and that I expect the time to 
impact on my dependent variable and to likely interact with the condition 
(treatment versus placebo).



I thought about conducting a simple repeated-measures ANOVA. However, as 
stated, I want to take the time between the two sessions into account. I also 
thought about an analysis of rates or percent changes. However, this approach 
does not model the correlation among the repeated measures and is thus 
associated with a reduction in power.



Accordingly, I am trying to use lme models to analyse my data. Since I have no 
between-group variable but a within-subjects design, I am concerned if my 
thoughts are correct and would be grateful for feedback.



I ran the longitudinal FS stream and followed the longitudinal lme model 
tutorial. I propose the following lme model with one random factor: thickness = 
intercept (random factor) + time since baseline + ICV + condition (placebo or 
treatment) + timeXcondition + Age (does not change across time interval) + 
gender



The analysis finishes with 0% non-covergence. Can you tell me if my model is 
suitable given the fact that it is a within-subjects design? I also started 
wondering if it was possible to model time as a random factor but I think that 
I read that this is not suitable if you only have two groups (in my case: 
conditions).



Thank you very much for help and advice!



All best wishes, Martina









Universitäre Psychiatrische Dienste Bern (UPD)
Universitätsklinik für Psychiatrie und Psychotherapie
Systemische Neurowissenschaften der Psychopathologie
Zentrum für Translationale Forschung
Dr. phil. Martina Papmeyer, Wissenschaftliche Mitarbeiterin
Bolligenstrasse 111, CH-3000 Bern 60
Tel: ++41 0(31) 930 9599, Fax: ++41 0(31) 930 9961
Mail: martina.papme...@puk.unibe.ch
www.puk.unibe.ch




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] LME for functional data, 3 factors

2016-04-15 Thread jorge luis

Hi Laura

-Before making anydecision please make sure you correct for multiple 
comparisons usinglme_mass_FDR2. That would reduce the likelihood of observing 
falsepositives. If very few voxels survived in random unexpected regionsafter 
the correction then you can decide to drop that covariate fromthe model.
-Yes the "lreml" fieldis the maximum likelihood estimate but you can only use 
it to comparemodels with exactly the same covariates and the same number 
butdifferent subsets of random effects. If you modify the values of 
onecovariate then you can not compare the modified model with theprevious model 
just on the basis of their maximum likelihoodestimates. 
-Well that isdifficult to know but the more statistical tests you do the 
morechances you have of observing false positives. Most of the timeresearchers 
have a-priori hypotheses about covariates and brainregions of interests.  

Best-Jorge

 
  De: Laura Rueda Delgado <laura.ruedadelg...@kuleuven.be>
 Para: jorge luis <jbernal0...@yahoo.es>; Freesurfer support list 
<freesurfer@nmr.mgh.harvard.edu> 
 Enviado: Jueves 14 de abril de 2016 11:23
 Asunto: Re: [Freesurfer] LME for functional data, 3 factors
   
#yiv6954010121 #yiv6954010121 -- _filtered #yiv6954010121 
{font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv6954010121 
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv6954010121 
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv6954010121 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv6954010121 
{font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered #yiv6954010121 
{font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;}#yiv6954010121 
#yiv6954010121 p.yiv6954010121MsoNormal, #yiv6954010121 
li.yiv6954010121MsoNormal, #yiv6954010121 div.yiv6954010121MsoNormal 
{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6954010121 a:link, 
#yiv6954010121 span.yiv6954010121MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv6954010121 a:visited, #yiv6954010121 
span.yiv6954010121MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv6954010121 pre 
{margin:0cm;margin-bottom:.0001pt;font-size:10.0pt;}#yiv6954010121 tt 
{}#yiv6954010121 p.yiv6954010121MsoAcetate, #yiv6954010121 
li.yiv6954010121MsoAcetate, #yiv6954010121 div.yiv6954010121MsoAcetate 
{margin:0cm;margin-bottom:.0001pt;font-size:8.0pt;}#yiv6954010121 
p.yiv6954010121MsoListParagraph, #yiv6954010121 
li.yiv6954010121MsoListParagraph, #yiv6954010121 
div.yiv6954010121MsoListParagraph 
{margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;font-size:12.0pt;}#yiv6954010121
 span.yiv6954010121HTMLPreformattedChar {font-family:Consolas;}#yiv6954010121 
p.yiv6954010121msonormal, #yiv6954010121 li.yiv6954010121msonormal, 
#yiv6954010121 div.yiv6954010121msonormal 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv6954010121 
p.yiv6954010121msochpdefault, #yiv6954010121 li.yiv6954010121msochpdefault, 
#yiv6954010121 div.yiv6954010121msochpdefault 
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;}#yiv6954010121 
span.yiv6954010121msohyperlink {}#yiv6954010121 
span.yiv6954010121msohyperlinkfollowed {}#yiv6954010121 
span.yiv6954010121emailstyle17 {}#yiv6954010121 
span.yiv6954010121htmlpreformattedchar {}#yiv6954010121 
span.yiv6954010121emailstyle20 {}#yiv6954010121 p.yiv6954010121msonormal1, 
#yiv6954010121 li.yiv6954010121msonormal1, #yiv6954010121 
div.yiv6954010121msonormal1 
{margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;color:black;}#yiv6954010121 
span.yiv6954010121msohyperlink1 
{color:blue;text-decoration:underline;}#yiv6954010121 
span.yiv6954010121msohyperlinkfollowed1 
{color:purple;text-decoration:underline;}#yiv6954010121 
span.yiv6954010121emailstyle171 {color:windowtext;}#yiv6954010121 
span.yiv6954010121htmlpreformattedchar1 
{font-family:Consolas;color:black;}#yiv6954010121 
span.yiv6954010121emailstyle201 {color:#1F497D;}#yiv6954010121 
p.yiv6954010121msochpdefault1, #yiv6954010121 li.yiv6954010121msochpdefault1, 
#yiv6954010121 div.yiv6954010121msochpdefault1 
{margin-right:0cm;margin-left:0cm;font-size:10.0pt;}#yiv6954010121 
span.yiv6954010121EmailStyle34 {color:#1F497D;}#yiv6954010121 
span.yiv6954010121BalloonTextChar {}#yiv6954010121 .yiv6954010121MsoChpDefault 
{font-size:10.0pt;} _filtered #yiv6954010121 {margin:70.85pt 70.85pt 70.85pt 
70.85pt;}#yiv6954010121 div.yiv6954010121WordSection1 {}#yiv6954010121 
_filtered #yiv6954010121 {} _filtered #yiv6954010121 {} _filtered 
#yiv6954010121 {} _filtered #yiv6954010121 {font-family:Wingdings;} _filtered 
#yiv6954010121 {font-family:Symbol;} _filtered #yiv6954010121 {} _filtered 
#yiv6954010121 {font-family:Wingdings;} _filtered #yiv6954010121 
{font-family:Symbol;} _filtered #yiv6954010121 {} _filtered #yiv6954010121 
{font-family:Wingdings;}#yiv6954010121 ol {margin-bottom:0cm;}#yiv6954010121 ul 
{margin-bottom:0cm;}#yiv6954010121 Dear 

Re: [Freesurfer] LME for functional data, 3 factors

2016-04-14 Thread Laura Rueda Delgado
Dear Jorge,

Thank you for your explanation. I’ve done what you suggested, starting with the 
maximal model for the mean including all covariates of interest and no 
interest. And then used F-tests for checking the significance of the covariates 
of no interest. Now I have three questions:

-  Since I’m fitting a mass univariate model, these F tests of 
covariates of no interest can result in a few voxels being significant (e.g. 
100) or in many voxels (>1.000) (with a significance threshold of 0.05). Is the 
final decision regarding those covariates with low number of significant voxels 
discretionary?

-  I’ve also started exploring different models with some modification 
of a covariate which could answer my question more directly. For choosing 
between two different models with equal random effects, on a previous thread it 
was recommended “to choose the one with higher maximum likelihood after model 
fitting” 
(https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/2014-September/040464.html<https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/2014-September/040464.html>).
 Is the maximum likelihood the ‘lreml’ field in the model structure (output of 
lme_mass_fit_vw)? Does this penalize for number of covariates?

-  Related to the previous question, how do I check if the model is 
over-fitting the data? My sample size is not very big, so I’m reconsidering the 
inclusion of covariates of no interest.

Thank you in advance for any suggestion!

Laura Rueda Delgado
Doctoral researcher
Department of Kinesiology- Motor Control and Neural Plasticity Research Group
KU Leuven
Tervuursevest 101 bus 1501
3001 Leuven, Belgium
tel. +32 16 37 64 78


From: jorge luis [mailto:jbernal0...@yahoo.es]
Sent: maandag 11 april 2016 20:34
To: Freesurfer support list
Cc: Laura Rueda Delgado
Subject: Re: [Freesurfer] LME for functional data, 3 factors

Hi Laura
In the wiki https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
we recommended to order the columns of the design matrix in the following way:

Column 1: the intercept term (which is a column of ones)

Colum 2: the time covariate if it varies across subjects (eg. time from 
baseline)

Column 3-q: any time-varying covariates (eg. training: 0 before training, 1 
after training)

Column q+1-r: the group covariates of interest (eg. a binary variable 
indicating whether or not the subject is a patient), for n groups you will have 
n-1 binary covariates

Column r+1-s: interactions between group covariates with the time-varying 
covariates (only the interesting interactions)

Column s+1-p: any other nuisance time-invariant covariates (eg. 
age-at-baseline, gender, etc...)


LME is a type of linear regression model that integrates both a model for the 
mean and a model for the covariance into a single statistical model. So if you 
want to compare different models for the mean (with different covariates) then 
you need to start with a “maximal model for the mean” that includes all the 
possible covariates of interest. Then you select the random effects for that 
"maximal model" using the model selection procedure with lme_mass_LR. Random 
effects can only be time-varying covariates (i.e a subset of the columns from 1 
to q above, those comprise the Zcols parameter in lme_mass_fit_vw)

After you choose which time-varying covariates are going to be considered as 
random effects then you can test if any single fixed effects covariate in your 
design matrix has a significant contribution to the model in the same way you 
would for a traditional GLM. You will use F-tests for that. Covariates that do 
not significantly contribute to the model can be ruled out of the model and a 
new model with less covariates but the same random effects can then be fitted.

Keep in mind that fitting lme models is computationally expensive and the 
computation overhead quickly increases with the number of random effects and 
fixed effects in your model. Also considering one or two random effects 
including the intercept term (or at most three) is usually enough but this 
really depends on the nature of the data.

Best
-Jorge



De: Laura Rueda Delgado <laura.ruedadelg...@kuleuven.be>
Para: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Enviado: Lunes 11 de abril de 2016 13:05
Asunto: Re: [Freesurfer] LME for functional data, 3 factors

Dear Martin,

Thank you for your quick response.

My research question is focused on the group and day effect, so I could 
simplify the model. From your response, I thought of including in the design 
matrix the binary code for Condition 2, and for Condition 3 in two columns, 
like you suggested; however, adding only the interaction effect of group and 
day. This way, the model takes into account the repeated measures of Condition 
while remaining relatively simple.

Now, to add more complexity and be more specific, I'm interested on neural 
corre

  1   2   >