Dear all,
A few questions come to me when I used LME Matlab toolbox. Then Jorge kindly answered my questions and he also asked me to post our discussion to Freesurfer list so everyone knows what's going on here :)
Cheers, Ting ------------------------------------------------------------------- *Subject: *Re: Re: issue about LME Matlab tools *Sent: *Tue, Dec 11, 2012 21:41:26
Hi Ting
Please could you post this question to the Freesurfer list, so other people can benefit from this discussion?
I'll answer you ASAP.
Best -Jorge
------------------------------------------------------ *Subject: *Re: Re: issue about LME Matlab tools *Sent: *Wed, Dec 12, 2012 6:44:36 AM
Hi Jorge,
Thank you for your explanation in more details. I followed your suggestion, set the convergence epsilon to 10^-5. It truly improved. I am now running the whole brain data, estimations in several voxels were not converge after 50 iterations. Given that iterations takes more computational time, how many iterations do you recommend and what do you usually do if it still not converge? Thank you again:)
Warmly regards,
Ting ------------------------------------------------------ *Subject:* Re: issue about LME Matlab tools *Sent: *Wed, Dec 12, 2012 00:50:35
Hi Ting
You needed more iterations to make the algorithm stop closer to the optimal values. Try:
statsFS= lme_fit_FS(X,[1 2],Y,ni,10^-5);
or the EM algorithm
statsEM = lme_fit_EM(X,[1 2],Y,ni,10^-10);
Neither of these algorithms can be guaranty to converge but I have found the FS algorithm to be the most robust and fast.
For the mass-univariate setting we limited the number of iterations for the FS algorithm to only 20 due to computational time.
Note that for only two repeated measures (as in your data) compound symmetry (a model with a single random effect for the intercept term) likely holds for the covariance matrix among the repeated measures. Although a likelihood ratio test here comparing the model with one random effects against the model with two random effects is barely significant it will not likely survive a multiple comparisons correction.
You can not impose structure on D in our toolbox nor it is recommended for general longitudinal data.
Let me know any doubt you might have.
Best -Jorge ------------------------------------------------------ *Subject: *issue about LME Matlab tools *Sent: *Tue, Dec 11, 2012 14:47:14
Dear Dr. Sabuncu
Your recent work "Statistical Analysis of Longitudinal Neuroimage Date with Linear Mixed Effects Models" provided us a great matlab toolbox to apply Mixed Model, especially for imaging data. Now, I am investigating the intraclass correlation based on this toolbox. Sometime I found the function "lme_fit_FS" could not get the accurate estimations. I think the problem may be relevant to the initial value from OLS method, in the case that the within-subject variability estimated from "lme_fit_init" is very close to zero. I attached an example. Y is test-retest imaging data for one voxel, X is design matrix including intercept, head_motion, age, gender. I set random effect for intercept and head_motion. I also attached result from SAS and the model is ok.
stats = lme_fit_FS(X,[1,2],Y,ni);
Here I'm wondering is there any way to fixed this in matlab?
PS, though you have mentioned that no imposed structure on D (covariance matrix of random effect), I am curious if it is possible to define the structure of D in this toolbox.
Thanks for your kind attention and look forward to your reply soon.
Regards, Ting
Hi Ting
Just use the default procedure. We limited the number of iterations for the estimation procedure to 20 for the mass-univariate analysis. If the model for the covariance is correct, that is to say, you have correctly specified the set of random effects that is supported by your data then the estimation at each vertex usually converges in a few iterations (between 5 and 9).
In your case, you have only two repeated measures in your data. In that scenario, you should only use a single random effect for the intercept term (or maybe for the head_motion time-varying covariate, see who produces better convergence results). You cannot use a model with two random effects when you only have two repeated measures because you don't have enough degrees of freedoms in your data. For example, if you had to estimate a completely unstructured covariance then you would only need to estimate three covariance parameters for two repeated measures, on the other hand if you impose structure on the covariance using the mixed effects model with two random effects then you are estimating four covariance components which will impose too much structure on the covariance and the estimation algorithm will fail to converge most of the time.
Finally, even when the set of random effects is correctly specified the iterative estimation procedure may not converge at several vertices (eg. 10% or may be more of the total number of vertices under analysis).
Hope this helps.
Best -Jorge
De: ting xu xutingxt@gmail.com Para: freesurfer@nmr.mgh.harvard.edu Enviado: Miércoles 12 de diciembre de 2012 9:22 Asunto: [Freesurfer] issue about LME Matlab tools
Dear all,
A few questions come to me when I used LME Matlab toolbox. Then Jorge kindly answered my questions and he also asked me to post our discussion to Freesurfer list so everyone knows what's going on here :)
Cheers, Ting
Subject: Re: Re: issue about LME Matlab tools Sent: Tue, Dec 11, 2012 21:41:26 Hi Ting Please could you post this question to the Freesurfer list, so other people can benefit from this discussion? I'll answer you ASAP. Best -Jorge
Subject: Re: Re: issue about LME Matlab tools Sent: Wed, Dec 12, 2012 6:44:36 AM
Hi Jorge,
Thank you for your explanation in more details. I followed your suggestion, set the convergence epsilon to 10^-5. It truly improved. I am now running the whole brain data, estimations in several voxels were not converge after 50 iterations. Given that iterations takes more computational time, how many iterations do you recommend and what do you usually do if it still not converge? Thank you again:)
Warmly regards,
Ting
Subject: Re: issue about LME Matlab tools Sent: Wed, Dec 12, 2012 00:50:35
Hi Ting
You needed more iterations to make the algorithm stop closer to the optimal values. Try:
statsFS= lme_fit_FS(X,[1 2],Y,ni,10^-5);
or the EM algorithm
statsEM = lme_fit_EM(X,[1 2],Y,ni,10^-10);
Neither of these algorithms can be guaranty to converge but I have found the FS algorithm to be the most robust and fast.
For the mass-univariate setting we limited the number of iterations for the FS algorithm to only 20 due to computational time.
Note that for only two repeated measures (as in your data) compound symmetry (a model with a single random effect for the intercept term) likely holds for the covariance matrix among the repeated measures. Although a likelihood ratio test here comparing the model with one random effects against the model with two random effects is barely significant it will not likely survive a multiple comparisons correction.
You can not impose structure on D in our toolbox nor it is recommended for general longitudinal data.
Let me know any doubt you might have.
Best
-Jorge
Subject: issue about LME Matlab tools Sent: Tue, Dec 11, 2012 14:47:14
Dear Dr. Sabuncu
Your recent work "Statistical Analysis of Longitudinal Neuroimage Date with Linear Mixed Effects Models" provided us a great matlab toolbox to apply Mixed Model, especially for imaging data. Now, I am investigating the intraclass correlation based on this toolbox. Sometime I found the function "lme_fit_FS" could not get the accurate estimations. I think the problem may be relevant to the initial value from OLS method, in the case that the within-subject variability estimated from "lme_fit_init" is very close to zero. I attached an example. Y is test-retest imaging data for one voxel, X is design matrix including intercept, head_motion, age, gender. I set random effect for intercept and head_motion. I also attached result from SAS and the model is ok.
stats = lme_fit_FS(X,[1,2],Y,ni);
Here I'm wondering is there any way to fixed this in matlab?
PS, though you have mentioned that no imposed structure on D (covariance matrix of random effect), I am curious if it is possible to define the structure of D in this toolbox.
Thanks for your kind attention and look forward to your reply soon.
Regards, Ting
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.
Hi Jorge,
Thank you for your careful explanations, it did help :) Regards, -Ting
On Wed, Dec 12, 2012 at 11:35 PM, jorge luis jbernal0019@yahoo.es wrote:
Hi Ting
Just use the default procedure. We limited the number of iterations for the estimation procedure to 20 for the mass-univariate analysis. If the model for the covariance is correct, that is to say, you have correctly specified the set of random effects that is supported by your data then the estimation at each vertex usually converges in a few iterations (between 5 and 9).
In your case, you have only two repeated measures in your data. In that scenario, you should only use a single random effect for the intercept term (or maybe for the head_motion time-varying covariate, see who produces better convergence results). You cannot use a model with two random effects when you only have two repeated measures because you don't have enough degrees of freedoms in your data. For example, if you had to estimate a completely unstructured covariance then you would only need to estimate three covariance parameters for two repeated measures, on the other hand if you impose structure on the covariance using the mixed effects model with two random effects then you are estimating four covariance components which will impose too much structure on the covariance and the estimation algorithm will fail to converge most of the time.
Finally, even when the set of random effects is correctly specified the iterative estimation procedure may not converge at several vertices (eg. 10% or may be more of the total number of vertices under analysis).
Hope this helps.
Best -Jorge
*De:* ting xu xutingxt@gmail.com *Para:* freesurfer@nmr.mgh.harvard.edu *Enviado:* Miércoles 12 de diciembre de 2012 9:22 *Asunto:* [Freesurfer] issue about LME Matlab tools
Dear all,
A few questions come to me when I used LME Matlab toolbox. Then Jorge kindly answered my questions and he also asked me to post our discussion to Freesurfer list so everyone knows what's going on here :)
Cheers, Ting
*Subject: *Re: Re: issue about LME Matlab tools *Sent: *Tue, Dec 11, 2012 21:41:26 Hi Ting Please could you post this question to the Freesurfer list, so other people can benefit from this discussion? I'll answer you ASAP. Best
-Jorge
*Subject: *Re: Re: issue about LME Matlab tools *Sent: *Wed, Dec 12, 2012 6:44:36 AM
Hi Jorge,
Thank you for your explanation in more details. I followed your suggestion, set the convergence epsilon to 10^-5. It truly improved. I am now running the whole brain data, estimations in several voxels were not converge after 50 iterations. Given that iterations takes more computational time, how many iterations do you recommend and what do you usually do if it still not converge? Thank you again:)
Warmly regards,
Ting
*Subject:* Re: issue about LME Matlab tools *Sent: *Wed, Dec 12, 2012 00:50:35
Hi Ting
You needed more iterations to make the algorithm stop closer to the optimal values. Try:
statsFS= lme_fit_FS(X,[1 2],Y,ni,10^-5);
or the EM algorithm
statsEM = lme_fit_EM(X,[1 2],Y,ni,10^-10);
Neither of these algorithms can be guaranty to converge but I have found the FS algorithm to be the most robust and fast.
For the mass-univariate setting we limited the number of iterations for the FS algorithm to only 20 due to computational time.
Note that for only two repeated measures (as in your data) compound symmetry (a model with a single random effect for the intercept term) likely holds for the covariance matrix among the repeated measures. Although a likelihood ratio test here comparing the model with one random effects against the model with two random effects is barely significant it will not likely survive a multiple comparisons correction.
You can not impose structure on D in our toolbox nor it is recommended for general longitudinal data.
Let me know any doubt you might have.
Best
-Jorge
*Subject: *issue about LME Matlab tools *Sent: *Tue, Dec 11, 2012 14:47:14
Dear Dr. Sabuncu
Your recent work "Statistical Analysis of Longitudinal Neuroimage Date with Linear Mixed Effects Models" provided us a great matlab toolbox to apply Mixed Model, especially for imaging data. Now, I am investigating the intraclass correlation based on this toolbox. Sometime I found the function "lme_fit_FS" could not get the accurate estimations. I think the problem may be relevant to the initial value from OLS method, in the case that the within-subject variability estimated from "lme_fit_init" is very close to zero. I attached an example. Y is test-retest imaging data for one voxel, X is design matrix including intercept, head_motion, age, gender. I set random effect for intercept and head_motion. I also attached result from SAS and the model is ok.
stats = lme_fit_FS(X,[1,2],Y,ni);
Here I'm wondering is there any way to fixed this in matlab?
PS, though you have mentioned that no imposed structure on D (covariance matrix of random effect), I am curious if it is possible to define the structure of D in this toolbox.
Thanks for your kind attention and look forward to your reply soon.
Regards, Ting
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.
Dear Jorge,
For the statistical analysis of longitudinal data we used the "Two Stage Model" (TSM) and the "Linear Mixed Effects".
Our intergroup LME results (2 groups, 2 time points) had many similarities with TSM results. Then with TSM we analysed the intragroup changes (one group, and 2 time points). We tried to do the same analysis with LME but the results are very different, so I suppose that the contrast was incorrect.
For the intergroup analysis (2 groups x 2 time points) I used /lme_mass_fit_vw/ and CM.C = [0 0 0 1];
For the intragroup (1 group x 2 time points) I also used /lme_mass_fit_vw/ but CM.C = [0 1];
Can you please tell me if the CM.C is correct ? or is there something else I should change ?
Thanks,
Best regards,
Alex.
Hi Alex
Certainly, for such a simple design matrix, only two repeated measures per subject with a small inter-subject variability in between-scan time interval and a very small number of subjects with a single time point the results from both procedures should not be very different. Furthermore, by using TSM you have the additional possibility of applying cluster-wise simulation-based multiple comparison procedures implemented in Freesurfer. LME must be used to address more complicated designs with time-varying covariates, variable timing across subjects, variable drop-out rate across measurement occasions, different number of repeated measures across subjects (even a single time point) and subjects with more than three repeated measures.
For your intra-group analyses using LME you simply need to test whether group-specific slopes of change are different from zero. You don't need to fit the model again for this. For the reference group you should simply test the coefficient of the time variable:
CM.C = [0 1 0 0]
and for the other group the contrast is given by the sum of the previous coefficient and the coefficient of the interaction term:
CM.C = [0 1 0 1]
Best -Jorge
De: Alex Hanganu al.hanganu@yahoo.ca Para: FS Mailing List Freesurfer@nmr.mgh.harvard.edu; Jorge L. Bernal-Rusiel jbernal@nmr.mgh.harvard.edu Enviado: Martes 12 de febrero de 2013 18:29 Asunto: [Freesurfer] LME - contrast
Dear Jorge,
For the statistical analysis of longitudinal data we used the "Two
Stage Model" (TSM) and the "Linear Mixed Effects".
Our intergroup LME results (2 groups, 2 time points) had many
similarities with TSM results. Then with TSM we analysed the intragroup changes (one group, and 2 time points). We tried to do the same analysis with LME but the results are very different, so I suppose that the contrast was incorrect.
For the intergroup analysis (2 groups x 2 time points) I used lme_mass_fit_vw and CM.C = [0 0 0 1];
For the intragroup (1 group x 2 time points) I also used lme_mass_fit_vw but CM.C = [0 1];
Can you please tell me if the CM.C is correct ? or is there
something else I should change ?
Thanks,
Best regards,
Alex.
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.
Hi Jorge,
Thanks again for the detailed and very helpful explanation !
I thought that all statistics should better be performed with LME in order to give more credibility to final results. But also it brings more trust if in the article statistics are performed with the same method. Anyway - we will present LME results.
Have a great day !
best wishes, Alex.
Le 2/13 0:18, jorge luis a écrit :
Hi Alex
Certainly, for such a simple design matrix, only two repeated measures per subject with a small inter-subject variability in between-scan time interval and a very small number of subjects with a single time point the results from both procedures should not be very different. Furthermore, by using TSM you have the additional possibility of applying cluster-wise simulation-based multiple comparison procedures implemented in Freesurfer. LME must be used to address more complicated designs with time-varying covariates, variable timing across subjects, variable drop-out rate across measurement occasions, different number of repeated measures across subjects (even a single time point) and subjects with more than three repeated measures.
For your intra-group analyses using LME you simply need to test whether group-specific slopes of change are different from zero. You don't need to fit the model again for this. For the reference group you should simply test the coefficient of the time variable:
CM.C = [0 1 0 0]
and for the other group the contrast is given by the sum of the previous coefficient and the coefficient of the interaction term:
CM.C = [0 1 0 1]
Best -Jorge
------------------------------------------------------------------------ *De:* Alex Hanganu <al.hanganu@yahoo.ca> *Para:* FS Mailing List <Freesurfer@nmr.mgh.harvard.edu>; Jorge L. Bernal-Rusiel <jbernal@nmr.mgh.harvard.edu> *Enviado:* Martes 12 de febrero de 2013 18:29 *Asunto:* [Freesurfer] LME - contrast Dear Jorge, For the statistical analysis of longitudinal data we used the "Two Stage Model" (TSM) and the "Linear Mixed Effects". Our intergroup LME results (2 groups, 2 time points) had many similarities with TSM results. Then with TSM we analysed the intragroup changes (one group, and 2 time points). We tried to do the same analysis with LME but the results are very different, so I suppose that the contrast was incorrect. For the intergroup analysis (2 groups x 2 time points) I used /lme_mass_fit_vw/ and CM.C = [0 0 0 1]; For the intragroup (1 group x 2 time points) I also used /lme_mass_fit_vw/ but CM.C = [0 1]; Can you please tell me if the CM.C is correct ? or is there something else I should change ? Thanks, Best regards, Alex. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto: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@nmr.mgh.harvard.edu