Re: [Freesurfer] Matrix ill-conditioned error for dods thickness mri_glmfit analysis

2017-08-16 Thread Douglas N Greve
posting the response to the list: The problem is that femalezero and 
femaletwo only have 4 and 3 subjects, respectively. As you are trying to 
estimate 4 slopes + an intercept, you will need at least 5 subjects per 
group.

doug




On 08/16/2017 03:27 PM, Sullivan, Danielle Renee wrote:
>
> Hi Doug,
>
>
> I am just following up to this email. If you prefer I can repost on 
> the FreeSurfer mail archive.
>
>
> Thanks,
>
> Danielle R. Sullivan (Miller), Ph.D.
>
> National Center for PTSD
>
> VA Boston Healthcare System Jamaica Plain
>
> Boston University School of Medicine
>
> OFFICE: (857) 364-4022
>
>
> 
> *From:* Sullivan, Danielle Renee
> *Sent:* Friday, August 11, 2017 1:33:03 PM
> *To:* Douglas N Greve
> *Subject:* Re: [Freesurfer] Matrix ill-conditioned error for dods 
> thickness mri_glmfit analysis
>
> I am still getting the same error. My apologies for the back and forth.
>
>
> Here are updated files (now there are 5 classes and contrast mtx has 
> been changed to reflect that).
>
>
> Danielle R. Sullivan (Miller), Ph.D.
>
> National Center for PTSD
>
> VA Boston Healthcare System Jamaica Plain
>
> Boston University School of Medicine
>
> OFFICE: (857) 364-4022
>
>
> 
> *From:* Douglas N Greve <gr...@nmr.mgh.harvard.edu>
> *Sent:* Friday, August 11, 2017 1:10:53 PM
> *To:* Sullivan, Danielle Renee
> *Subject:* Re: [Freesurfer] Matrix ill-conditioned error for dods 
> thickness mri_glmfit analysis
> remove the definition too
>
>
> On 08/11/2017 12:46 PM, Sullivan, Danielle Renee wrote:
> >
> > Hi,
> >
> >
> > Thank you for the tips. I tried doing both and still run into the
> > error (although now I get a warning that the class femaleone is
> > defined but not used). Attached is my new FSGD (now all variables
> > normalized via a Z-score), XG.mtx, Contrast, and Terminal output.
> >
> >
> > Thanks again for the help!
> >
> >
> > Danielle R. Sullivan (Miller), Ph.D.
> >
> > National Center for PTSD
> >
> > VA Boston Healthcare System Jamaica Plain
> >
> > Boston University School of Medicine
> >
> > OFFICE: (857) 364-4022
> >
> >
> > 
> > *From:* Douglas N Greve <gr...@nmr.mgh.harvard.edu>
> > *Sent:* Friday, August 11, 2017 11:12:21 AM
> > *To:* Sullivan, Danielle Renee
> > *Subject:* Re: [Freesurfer] Matrix ill-conditioned error for dods
> > thickness mri_glmfit analysis
> > there appear to be two problems. One is that you only have one instance
> > of femaleone. This might be ok if you had no covariates, but you can't
> > estimate a covariate slope from one data point. Second, the scale of
> > your covariates is much different, so you may need to normalize them. I
> > would try removing the lone femaleone and rerun
> >
> >
> > On 08/11/2017 10:35 AM, Sullivan, Danielle Renee wrote:
> > >
> > > Hi Doug,
> > >
> > >
> > > Thanks for your response and help.
> > >
> > >
> > > Attached is the matrix and the terminal output. Please let me know if
> > > you need anything else.
> > >
> > >
> > >
> > > Danielle R. Sullivan (Miller), Ph.D.
> > >
> > > National Center for PTSD
> > >
> > > VA Boston Healthcare System Jamaica Plain
> > >
> > > Boston University School of Medicine
> > >
> > > OFFICE: (857) 364-4022
> > >
> > >
> > > can you send the design matrix Xg.mtx and the full terminal output?
> > > On 08/08/2017 09:13 AM, Sullivan, Danielle Renee wrote:
> > > >
> > > > Hi FreeSurfer Experts,
> > > >
> > > >
> > > > I am trying to run a dods cortical thickness analysis examining the
> > > > interaction of group on a continuous variable while controlling for
> > > > other variables.
> > > >
> > > >
> > > > Specifically, I have 6 classes (gender by three groups [zero, one,
> > > > two]). I am interested in the group interaction with a continuous
> > > > variable while controlling for gender (among 4 other continuous
> > > > variables). I set up my fsgd file (see attached) and contrast file
> > (36
> > > > dimensions- F test):
> > > >
> >

Re: [Freesurfer] Matrix ill-conditioned error for dods thickness mri_glmfit analysis

2017-08-09 Thread Douglas N Greve
can you send the design matrix Xg.mtx and the full terminal output?


On 08/08/2017 09:13 AM, Sullivan, Danielle Renee wrote:
>
> Hi FreeSurfer Experts,
>
>
> I am trying to run a dods cortical thickness analysis examining the 
> interaction of group on a continuous variable while controlling for 
> other variables.
>
>
> Specifically, I have 6 classes (gender by three groups [zero, one, 
> two]). I am interested in the group interaction with a continuous 
> variable while controlling for gender (among 4 other continuous 
> variables). I set up my fsgd file (see attached) and contrast file (36 
> dimensions- F test):
>
> *0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [1 -1 0 1 
> -1 0]/2*
>
> *0 0 0 0 0 0 **0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [1 -0 
> -1 1  0 -1]/2*
>
>
> and ran this command:
>
>
> *mri_glmfit --y 
> **lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.mgh
>  
> --fsgd 
> fsgd.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forFSGD.152.thickness.08082017.txt
>  
> dods --C 
> /GLM_CONTRAST.MAT/Contrast.Male.Female.Age.PC1.PC2.PC3.GGT.RORAbySex.mtx 
> --surf fsaverage lh --cortex --glmdir 
> lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.glmdir
>  
> *
>
>
> But keep getting this error:
>
>
> *ERROR: matrix is ill-conditioned or badly scaled, condno = 1e+08*
>
> **
>
> *Possible problem with experimental design:*
>
> *Check for duplicate entries and/or lack of range of*
>
> *continuous variables within a class.*
>
> *If you seek help with this problem, make sure to send:*
>
> *  1. Your command line:*
>
> *mri_glmfit --y 
> lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.mgh
>  
> --fsgd 
> fsgd.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forFSGD.152.thickness.08082017.txt
>  
> dods --C 
> /Volumes/VA_Imaging/Projects/salat/2389_TRT/dmiller/GGT_CRP/GLM_CONTRAST.MAT/Contrast.Male.Female.Age.PC1.PC2.PC3.GGT.RORAbySex.mtx
>  
> --surf fsaverage lh --cortex --glmdir 
> lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.glmdir
>  
> *
>
> *  2. The FSGD file (if using one)*
>
> *  3. And the design matrix above*
>
>
>
> Any idea on what I am doing wrong?
>
>
> Danielle R. Miller, Ph.D.
>
> National Center for PTSD
>
> VA Boston Healthcare System Jamaica Plain
>
> Boston University School of Medicine
>
> OFFICE: (857) 364-4022
>
>
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

-- 
Douglas N. Greve, Ph.D.
MGH-NMR Center
gr...@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422

Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/

___
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] Matrix ill-conditioned error for dods thickness mri_glmfit analysis

2017-08-08 Thread Sullivan, Danielle Renee
Hi FreeSurfer Experts,


I am trying to run a dods cortical thickness analysis examining the interaction 
of group on a continuous variable while controlling for other variables.


Specifically, I have 6 classes (gender by three groups [zero, one, two]). I am 
interested in the group interaction with a continuous variable while 
controlling for gender (among 4 other continuous variables). I set up my fsgd 
file (see attached) and contrast file (36 dimensions- F test):

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [1 -1 0 1 -1 0]/2

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [1 -0 -1 1  0 -1]/2


and ran this command:


mri_glmfit --y  
lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.mgh
 --fsgd 
fsgd.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forFSGD.152.thickness.08082017.txt
 dods --C 
/GLM_CONTRAST.MAT/Contrast.Male.Female.Age.PC1.PC2.PC3.GGT.RORAbySex.mtx --surf 
fsaverage lh --cortex --glmdir 
lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.glmdir


But keep getting this error:


ERROR: matrix is ill-conditioned or badly scaled, condno = 1e+08



Possible problem with experimental design:

Check for duplicate entries and/or lack of range of

continuous variables within a class.

If you seek help with this problem, make sure to send:

  1. Your command line:

mri_glmfit --y 
lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.mgh
 --fsgd 
fsgd.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forFSGD.152.thickness.08082017.txt
 dods --C 
/Volumes/VA_Imaging/Projects/salat/2389_TRT/dmiller/GGT_CRP/GLM_CONTRAST.MAT/Contrast.Male.Female.Age.PC1.PC2.PC3.GGT.RORAbySex.mtx
 --surf fsaverage lh --cortex --glmdir 
lh.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forfsgd.thickness.10.glmdir

  2. The FSGD file (if using one)

  3. And the design matrix above



Any idea on what I am doing wrong?

Danielle R. Miller, Ph.D.
National Center for PTSD
VA Boston Healthcare System Jamaica Plain
Boston University School of Medicine
OFFICE: (857) 364-4022

GroupDescriptorFile 1
Title 
fsgd.age.PC1_forFSGD.PC2_forFSGD.PC3_forFSGD.GGT_forFSGD.rs8042149_A_bysex_forFSGD.152.thickness.08082017.txt
MeasurementName thickness

Class femalezero
Class femaleone
Class femaletwo
Class malezero
Class maleone
Class maletwo

Variables age PC1_forFSGD PC2_forFSGD PC3_forFSGD GGT_forFSGD

#Input TRT_0007 = 43 = = = =
#Input TRT_0015 = 38 = = = =
#Input TRT_0016 femalezero 47 0.0295 -0.1271 0.0693 =
#Input TRT_0017 maleone 29 0.0583 0.1283 -0.0139 =
#Input TRT_0019 = 43 = = = =
#Input TRT_0020 = 28 = = = =
#Input TRT_0022 malezero 23 0.0324 0.0381 0.0355 =
#Input TRT_0025 maletwo 24 -0.0619 -0.0585 -0.0010 =
#Input TRT_0026 maleone 26 0.0344 0.1225 0.0991 =
#Input TRT_0027 femaletwo 43 -0.0417 0.0989 0.0776 =
#Input TRT_0028 = 37 = = = =
#Input TRT_0030 maleone 23 0.0230 0.0637 0.0496 =
#Input TRT_0031 maleone 19 -0.0498 0.0925 -0.0851 =
#Input TRT_0032 femalezero 25 -0.0151 -0.0589 -0.0538 =
#Input TRT_0033 malezero 24 0.0675 -0.1426 0.0793 =
#Input TRT_0034 maletwo 39 -0.0826 0.0282 0.0109 =
#Input TRT_0035 maletwo 32 0.1583 -0.0853 -0.0525 =
#Input TRT_0036 maleone 49 0.1116 -0.0184 -0.0206 =
#Input TRT_0037 malezero 27 0.0836 0.0867 0.0418 =
#Input TRT_0038 = 44 = = = =
Input TRT_0042 malezero 20 0.0775 0.0252 0.0351 15
#Input TRT_0043 maleone 49 -0.0615 -0.0789 0.0855 =
#Input TRT_0045 malezero 38 -0.0078 -0.0248 -0.0194 =
#Input TRT_0047 maletwo 26 -0.0431 -0.0585 -0.0031 =
#Input TRT_0048 = 31 = = = 28
#Input TRT_0049 femaletwo 23 -0.0237 0.0189 -0.0160 =
#Input TRT_0050 = 32 = = = =
#Input TRT_0051 = 43 = = = =
#Input TRT_0052 malezero 29 -0.0980 0.0265 0.1271 =
#Input TRT_0055 malezero 33 0.1757 0.0140 -0.0469 =
Input TRT_0057 maletwo 26 0.1976 0.0419 -0.0359 32
#Input TRT_0058 = 58 = = = 10
Input TRT_0059 malezero 42 -0.0061 0.1113 -0.0729 29
#Input TRT_0060 = 37 = = = 33
Input TRT_0061 maleone 34 0.0508 -0.0194 0.0931 22
Input TRT_0062 maletwo 42 -0.1008 -0.1552 0.0298 46
#Input TRT_0063 maleone 46 -0.0077 -0.0068 0.0540 =
Input TRT_0064 maleone 47 0.0792 -0.1128 0.1746 13
Input TRT_0065 maletwo 55 -0.0489 -0.1078 0.0532 65
#Input TRT_0066 = 35 = = = 26
Input TRT_0067 maleone 40 -0.0759 0.0753 -0.0375 24
Input TRT_0068 maleone 24 -0.1071 0.0256 -0.0220 48
#Input TRT_0069 = 44 = = = 26
Input TRT_0070 maleone 47 -0.0551 0.0043 0.0556 29
Input TRT_0071 malezero 28 0.0037 -0.0156 0.0113 19
Input TRT_0072 malezero 31 0.0855 -0.0362 -0.0036 20
Input TRT_0073 malezero 21 -0.0363 0.0048 0.0014 56
Input TRT_0075 maletwo 42 -0.0713 0.0286 -0.1274 30
Input TRT_0076 malezero 33 0.0995 -0.0306 0.0634 23
Input TRT_0078 maleone 39 0.1166 -0.1302 -0.0220 19
Input TRT_0079 maletwo 33 -0.0696 0.0533 -0.0207 24
Input TRT_0082 malezero 58 0.0669 -0.0484 -0.1014 54
Input