remove the 1st column and it will be ok

On 6/14/16 6:24 AM, Hao wen wrote:

It turned out this is not possible, I got this error:


ERROR: matrix is ill-conditioned or badly scaled, condno = 1.34551e+07

here is my design matrix:


1              AD     CN      age       male female

1.000   0.000   1.000   74.300   0.000   1.000;
 1.000   0.000   1.000   73.700   0.000   1.000;
 1.000   0.000   1.000   84.500   1.000   0.000;
 1.000   0.000   1.000   78.500   1.000   0.000;
 1.000   0.000   1.000   80.800   0.000   1.000;
 1.000   0.000   1.000   65.400   0.000   1.000;
 1.000   0.000   1.000   73.100   1.000   0.000;
 1.000   0.000   1.000   72.600   1.000   0.000;
 1.000   0.000   1.000   63.200   0.000   1.000;
 1.000   0.000   1.000   71.700   0.000   1.000;
 1.000   0.000   1.000   77.700   1.000   0.000;
 1.000   0.000   1.000   76.900   0.000   1.000;
 1.000   0.000   1.000   73.200   0.000   1.000;
 1.000   0.000   1.000   76.200   0.000   1.000;
 1.000   0.000   1.000   84.700   0.000   1.000;
 1.000   0.000   1.000   69.600   1.000   0.000;
 1.000   0.000   1.000   70.100   0.000   1.000;
 1.000   0.000   1.000   70.900   1.000   0.000;
 1.000   0.000   1.000   77.000   1.000   0.000;
 1.000   0.000   1.000   74.500   0.000   1.000;
 1.000   0.000   1.000   74.400   1.000   0.000;
 1.000   0.000   1.000   72.900   0.000   1.000;
 1.000   0.000   1.000   74.000   0.000   1.000;
 1.000   0.000   1.000   70.600   0.000   1.000;
 1.000   0.000   1.000   78.200   0.000   1.000;
 1.000   0.000   1.000   70.600   0.000   1.000;
 1.000   0.000   1.000   80.300   1.000   0.000;
 1.000   0.000   1.000   65.100   0.000   1.000;
 1.000   0.000   1.000   69.800   0.000   1.000;
 1.000   0.000   1.000   71.100   0.000   1.000;
 1.000   1.000   0.000   81.300   0.000   1.000;
 1.000   1.000   0.000   75.400   0.000   1.000;
 1.000   1.000   0.000   73.900   1.000   0.000;
 1.000   1.000   0.000   64.100   0.000   1.000;
 1.000   1.000   0.000   80.100   0.000   1.000;
 1.000   1.000   0.000   78.300   0.000   1.000;
 1.000   1.000   0.000   73.200   0.000   1.000;
 1.000   1.000   0.000   75.300   1.000   0.000;
 1.000   1.000   0.000   65.600   0.000   1.000;
 1.000   1.000   0.000   62.400   0.000   1.000;
 1.000   1.000   0.000   77.200   1.000   0.000;
 1.000   1.000   0.000   70.700   1.000   0.000;
 1.000   1.000   0.000   70.100   1.000   0.000;
 1.000   1.000   0.000   82.600   1.000   0.000;
 1.000   1.000   0.000   80.200   1.000   0.000;
 1.000   1.000   0.000   65.900   1.000   0.000;
 1.000   1.000   0.000   59.700   1.000   0.000;
 1.000   1.000   0.000   71.800   0.000   1.000;
 1.000   1.000   0.000   72.400   1.000   0.000;
 1.000   1.000   0.000   80.500   1.000   0.000;
 1.000   1.000   0.000   62.900   0.000   1.000;
 1.000   1.000   0.000   67.400   0.000   1.000;
 1.000   1.000   0.000   80.200   1.000   0.000;
 1.000   1.000   0.000   85.500   0.000   1.000;
 1.000   1.000   0.000   65.900   0.000   1.000;
 1.000   1.000   0.000   89.100   1.000   0.000;
 1.000   1.000   0.000   56.400   0.000   1.000;
 1.000   1.000   0.000   82.700   0.000   1.000;
 1.000   1.000   0.000   68.300   0.000   1.000;
 1.000   1.000   0.000   74.000   0.000   1.000;

and my contrast is: -1 1 0 0 0,


So I think right now you should understand what I mean, sorry for the mess!


In SurfStat, they treat these variables as main effect, and gender*group as interaction, so my question is in FS, do we have a way to do this like main effect for the categorized factor?


Hope to hear from you soon!

------------------------------------------------------------------------
*De :* freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mgh.harvard.edu> de la part de Hao wen <hao.freesur...@hotmail.com>
*Envoyé :* mardi 14 juin 2016 12:10:38
*À :* Freesurfer support list
*Objet :* Re: [Freesurfer] Define the design matrix by myself

Hello:

To make it more clear!


I thought from FSGD file in mris_preproc, it will regard the group and gender as class, so in the X.dat will be gender*group; will not be possible to have the seperate columns for gender and group? do I understand it correctly?

Or the FSGD file used in mris-preproc has nothing to do with the design matrix? It is used just to gather the thickness info from all the subjects?


Thank you

------------------------------------------------------------------------
*De :* freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mgh.harvard.edu> de la part de Hao wen <hao.freesur...@hotmail.com>
*Envoyé :* mardi 14 juin 2016 09:25:06
*À :* Freesurfer support list
*Objet :* Re: [Freesurfer] Define the design matrix by myself
Yes, actually, I just want to know what does that mean when we use *, for example Gender*Group, does this mean group and gender has a interaction? So what i want to know, if we can create design matrix like this:
   X = 1 + age + gender + group,
I dont want the interact between group and gender

Hope to hear from you soon!
Merci
Hao
------------------------------------------------------------------------
*De :* freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mgh.harvard.edu> de la part de Douglas Greve <gr...@nmr.mgh.harvard.edu>
*Envoyé :* mardi 14 juin 2016 04:20:18
*À :* freesurfer@nmr.mgh.harvard.edu
*Objet :* Re: [Freesurfer] Define the design matrix by myself
sorry, I don't understand the question. It looks like the design matrix is right. It looks like the contrasts tests for a diff between AD and controls. What else do you need?

On 6/13/16 8:49 AM, Hao wen wrote:

Hello:

I am still confused about how to make the design matrix in FS for group analysis:


I want to create a design matrix like this: X = 1 + TermAge + TermGender * TermGroup (this should be like

Age

        

Female

*

AD

        

Male

*

AD

        

Female

*

CN

        

Male

*

CN


)


There are just 5 columns, not like DODS, we have 8 columns:


Here is my commandline process:


1) in mris_preproc, we gathered the thickness info from every subjects, the cml is as below:


mris_preproc --fsgd AD_CN_COVARIATES_AGE_GENDER.fsgd \
  --cache-in thickness.fwhm15.fsaverage \
  --target fsaverage \
  --hemi lh \
  --out lh.AD_CN_COVARIATES_AGE_GENDER_thickness_15.mgh


after this we use mri_glmfit :


mri_glmfit --glmdir lh.AD_CN_COVARIAETS_AGE_GENDER.glmdir\
  --y lh.AD_CN_COVARIATES_AGE_GENDER_thickness_15.mgh \
  --C Contrast.mtx \
  --X X_5_intersect.mat\
  --surf fsaverage lh \
  --cortex

After this command:

In the command here, the Contrast.mtx is +0.00000 +1.00000 +1.00000 -1.00000 -1.00000 ,but it the result turns out that the contrast should be +0.00000 -1.00000 -1.00000 +1.00000 +1.00000, cuz the thickness of CN should be bigger than that of AD, so my question is how to know which colomn in the contrastshould be Female*CN, Male*CN, Female*AD, Male*AD, I know in DODS, DOSS, this is related how do you how you order your class in the FSGD file, but here, I just have 5 columns, I dont know how to make the correspondences, I can just deduce it from my results, so I attached my FSGD file for you!

the design matrix is , Xg.dat, I ceate the design matrix, design_matrix.mat from matlab:

+74.30000 +0.00000 +0.00000 +0.00000 +1.00000
+73.70000 +0.00000 +0.00000 +0.00000 +1.00000
+84.50000 +0.00000 +0.00000 +1.00000 +0.00000
+78.50000 +0.00000 +0.00000 +1.00000 +0.00000
+80.80000 +0.00000 +0.00000 +0.00000 +1.00000
+65.40000 +0.00000 +0.00000 +0.00000 +1.00000
+73.10000 +0.00000 +0.00000 +1.00000 +0.00000
+72.60000 +0.00000 +0.00000 +1.00000 +0.00000
+63.20000 +0.00000 +0.00000 +0.00000 +1.00000
+71.70000 +0.00000 +0.00000 +0.00000 +1.00000
+77.70000 +0.00000 +0.00000 +1.00000 +0.00000
+76.90000 +0.00000 +0.00000 +0.00000 +1.00000
+73.20000 +0.00000 +0.00000 +0.00000 +1.00000
+76.20000 +0.00000 +0.00000 +0.00000 +1.00000
+84.70000 +0.00000 +0.00000 +0.00000 +1.00000
+69.60000 +0.00000 +0.00000 +1.00000 +0.00000
+70.10000 +0.00000 +0.00000 +0.00000 +1.00000
+70.90000 +0.00000 +0.00000 +1.00000 +0.00000
+77.00000 +0.00000 +0.00000 +1.00000 +0.00000
+74.50000 +0.00000 +0.00000 +0.00000 +1.00000
+74.40000 +0.00000 +0.00000 +1.00000 +0.00000
+72.90000 +0.00000 +0.00000 +0.00000 +1.00000
+74.00000 +0.00000 +0.00000 +0.00000 +1.00000
+70.60000 +0.00000 +0.00000 +0.00000 +1.00000
+78.20000 +0.00000 +0.00000 +0.00000 +1.00000
+70.60000 +0.00000 +0.00000 +0.00000 +1.00000
+80.30000 +0.00000 +0.00000 +1.00000 +0.00000
+65.10000 +0.00000 +0.00000 +0.00000 +1.00000
+69.80000 +0.00000 +0.00000 +0.00000 +1.00000
+71.10000 +0.00000 +0.00000 +0.00000 +1.00000
+81.30000 +0.00000 +1.00000 +0.00000 +0.00000
+75.40000 +0.00000 +1.00000 +0.00000 +0.00000
+73.90000 +1.00000 +0.00000 +0.00000 +0.00000
+64.10000 +0.00000 +1.00000 +0.00000 +0.00000
+80.10000 +0.00000 +1.00000 +0.00000 +0.00000
+78.30000 +0.00000 +1.00000 +0.00000 +0.00000
+73.20000 +0.00000 +1.00000 +0.00000 +0.00000
+75.30000 +1.00000 +0.00000 +0.00000 +0.00000
+65.60000 +0.00000 +1.00000 +0.00000 +0.00000
+62.40000 +0.00000 +1.00000 +0.00000 +0.00000
+77.20000 +1.00000 +0.00000 +0.00000 +0.00000
+70.70000 +1.00000 +0.00000 +0.00000 +0.00000
+70.10000 +1.00000 +0.00000 +0.00000 +0.00000
+82.60000 +1.00000 +0.00000 +0.00000 +0.00000
+80.20000 +1.00000 +0.00000 +0.00000 +0.00000
+65.90000 +1.00000 +0.00000 +0.00000 +0.00000
+59.70000 +1.00000 +0.00000 +0.00000 +0.00000
+71.80000 +0.00000 +1.00000 +0.00000 +0.00000
+72.40000 +1.00000 +0.00000 +0.00000 +0.00000
+80.50000 +1.00000 +0.00000 +0.00000 +0.00000
+62.90000 +0.00000 +1.00000 +0.00000 +0.00000
+67.40000 +0.00000 +1.00000 +0.00000 +0.00000
+80.20000 +1.00000 +0.00000 +0.00000 +0.00000
+85.50000 +0.00000 +1.00000 +0.00000 +0.00000
+65.90000 +0.00000 +1.00000 +0.00000 +0.00000
+89.10000 +1.00000 +0.00000 +0.00000 +0.00000
+56.40000 +0.00000 +1.00000 +0.00000 +0.00000
+82.70000 +0.00000 +1.00000 +0.00000 +0.00000
+68.30000 +0.00000 +1.00000 +0.00000 +0.00000
+74.00000 +0.00000 +1.00000 +0.00000 +0.00000

So my question is how to correspond the different column to the contrast matrix and this (

Age

        

Female

*

AD

        

Male

*

AD

        

Female

*

CN

        

Male

*

CN

)

So , do you have some specific tutorial for this kind of analysis, if not, can you clarify this to me a little and I would like to make a tutorial for this, cuz

------------------------------------------------------------------------
*De :* freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mgh.harvard.edu> de la part de Hao wen <hao.freesur...@hotmail.com>
*Envoyé :* vendredi 10 juin 2016 11:10:37
*À :* freesurfer@nmr.mgh.harvard.edu
*Objet :* [Freesurfer] GLM: Define the design matrix by myself
Hello, Freesurfer experts:
I want to define the design matrix by myself in GLM, I know that in FS, when we deal with the categorized factors, we treat them as classes, So basically, I want to make a design matrix like this: 1) formula_EffectOnGroupWithAgeGenderCovariates = 1 + TermGroup + TermAge + TermGender
and
2) formula_EffectOnGroupWithAgeGenderInterectionCovariates = 1 + TermAge + TermGender * TermGroup

Here, TermGroup and TermGender are categorized factors, so I know that we can make the design matrix like 2) in FS, cuz here we define it as intersection, but my question is that if wen can define a matrix like the first one? I know in SurfStat, we can define it like 1)

Hope to hear from you soon:)

thank you in advance!



_______________________________________________
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 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.

Reply via email to