Hi, Anderson.

Thank you for your reply


1) I tried to run subcortical volumes in csv file as:
palm -i subcortical.csv -d design_matrix_con_vs_three_groups.mat -t contrast_matrix_con_vs_three_groups.con -f f_contrast_matrix_con_vs_three_groups.fts -o bh.results -n 1000 -corrcon -approx tail -T -logp -fdr -saveparametric  -nouncorrected

but palm complained that "To use spatial statistics with vertexwise or facewise data it is necessary to provide the surface files (with the option "-s")". I will appreciate if you could please point out what needs to be changed in the call to palm for the script to run. Do I have to pass -m or -s to this call? If so, what are these files and where do I obtain them from?

2) Thickness vs perfusion -- EV per voxel 

palm -i bh.cbf.mgz -s bh.white -evperdat bh.thickness.mgz -o bh.results -n 1000 -corrcon -approx tail -T -logp -fdr -saveparametric  -nouncorrected -demean

bh.* files have 3 groups (row 1-15 = Controls; row 2-60= Group1; row 61-100= Group2) How do I set up the design and contrast matrix to check
a) there is +/- association of CBF and thickness within the group after regressing the effect of age, gender, race, ICV.
b) there is a difference in this association of CBF and thickness between the group after regressing the effect of age, gender, race, ICV, education.


3) Thickness vs subcortical volumes -- Design matrix.

Design Matrix:
EV1: Left Pallidum volume for Controls; others  = 0;
EV2: Left Pallidum volume for Group1; others  = 0;
EV3: Left Pallidum volume for Group2; others  = 0;
EV4: Age
EV5: Gender +1/-1 Male/Female
EV6: ICV
EV7: Race A/B -1/+1 ; Others = 0;
EV8: Race A/C -1/+1 ; Others = 0;
EV9: Race A/D -1/+1 ; Others = 0;
EV10: Race A/E -1/+1 ; Others = 0;
EV11: Race A/F -1/+1 ; Others = 0;
EV12: education

Contrast Matrix:
C1: 1 0 0 0 0 .... CBF positive associated with left pallidum volume after regressing the effects of other variables in controls
C2: -1 0 0 0 0 ... CBF positive associated with left pallidum volume after regressing the effects of other variables in controls
C3: 0 1 0 0 0 .... CBF positive associated with left pallidum volume after regressing the effects of other variables in grp1
C4: 0 -1 0 0 0 ... CBF positive associated with left pallidum volume after regressing the effects of other variables in grp1
C5: 0 0 1 0 0 .... CBF positive associated with left pallidum volume after regressing the effects of other variables in grp2
C6: 0 0 -1 0 0 ... CBF positive associated with left pallidum volume after regressing the effects of other variables in grp2
C7: 1 -1 0 0 0 ... CBF association with volume in controls > CBF association with volume in grp1
C8: -1 1 0 0 0 ... CBF association with volume in controls < CBF association with volume in grp1
C9: 1 0 -1 0 0 ... CBF association with volume in controls > CBF association with volume in grp2
C10: -1 0 1 0 0 ... CBF association with volume in controls < CBF association with volume in grp2
C11: 0 1 -1 0 0 ... CBF association with volume in grp1 > CBF association with volume in grp2
C12: 0 -1 1 0 0  ... CBF association with volume in grp1 < CBF association with volume in grp2

Then I create several design matrices changing EV1-3 with different subcortical volumes and call PALM as:

palm -i bh_cbf.mgz -s bh.white -d left_pallidum.mat -d right_pallidum.mat -d ...... -t design.con -o results -n 1000 -corrcon -approx tail -T -logp -fdr -saveparametric  -nouncorrected -corrmod

Is my understanding right?

I will greatly appreciate your inputs.

Thanks

Regards

--VM


On Thu, Jan 5, 2017 at 2:52 AM, Anderson M. Winkler <[log in to unmask]> wrote:
Hi VM,

Please see below:

On 4 January 2017 at 21:46, neuroimage analyst <[log in to unmask]> wrote:
Hi, Anderson.

Thank you for your response.

I am still unclear how to set the contrasts for race (EV5 to EV9) and I will appreciate if you could please comment

Are these contrasts correct?
 0,0,0,0,0,1,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
 0,0,0,0,0,0,1,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,0,0,0,0,0,0,1,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,0,0,0,0,0,0,1,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,0,0,0,0,0,1,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

Almost. For EV5 to EV9, the F-test would be:

0,0,0,0,1,0,0,0,0,0,...
0,0,0,0,0,1,0,0,0,0,...
0,0,0,0,0,0,1,0,0,0,...
0,0,0,0,0,0,0,1,0,0,...
0,0,0,0,0,0,0,0,1,0,...

To enter it, these lines would have to appear in the design.con file. Suppose the design.con file has 10 lines, with these above being the last 5. Then to specify the F-test, the design.fts would have to have one line that is:

0 0 0 0 0 1 1 1 1 1

That is, one line for each F-test (one in this case), each with 10 digits (for the 10 contrasts in the .con file), with zeroes and ones indicating which of them would constitute the F-test. This is exactly the same way as randomise uses F-tests, and these files can be generated automatically with the command Glm (or Glm_gui in the Mac), such that you don't have to worry about creating them by hand.

Alternatively, it's possible to use the .mset files, i.e., a single text file containing all t and F-contrasts. This is described here: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM/UserGuide#Support_for_MSET_files

The benefit of using .mset files is that the contrasts are run exactly as entered, and for F-tests, only the actual F-test is run, as opposed to each of its rows as a separate t-test.



then f- test  as 
1 1 ? with no additional 0s? Also do I have to create another -t for race followed by -f meaning
palm -i input -d design.mat -t design_without_race -t only_race -f  f_for_race OR palm -i input -d design_with_race.mat -f  f_for_race

palm -i input -d design.mat -t design.con -f design.fts [...]

or

palm -i input -d design.mat -con design.mset [...]
 


Second, I want to test subcortical volumes (as csv) in the same call to palm. so my understanding is I can add -i subcortical.csv? Since, I invoke -tfce2D for surfaces; subcortical will also work with 2D which may be not right. Then how do I modify the call to palm?

The benefit of using the subcortical volumes in the same call is to correct for multiple testing. However, TFCE isn't a pivotal statistic and multiple testing correction here will not work as expected. So, either:

a) Put subcortical in the same call (-i subcortical.csv), add -corrmod, and drop TFCE.

or:

b) Use TFCE for the cortical area and thickness, but run PALM separately for subcortical volumes.
 

Third, in the contrast of 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 , if I find Con>grp1 can I say that controls had a higher thickness than grp 1 after controlling for other covariates?

If EV1 codes for Con and EV2 codes for group 1, yes.
 

Fourth, I need to test if thickness and perfusion, and perfusion and subcortical volumes have any relationship among them for any group? Can I use a single palm call to achieve this or I have to call palm 2 more times with -evperdat option? Also, subcortical volumes are not ev per voxel, how do I achieve testing for the association between subcortical volume and perfusion? Hopefully there is a way for one call to palm and test for everything. I will greatly appreciate your inputs.

For thickness vs. perfusion, both being vertexwise, you'd use vertexwise EVs with the option -evperdat.

For perfusion vs. subcortical volumes, you'd use perfusion as input (-i), and multiple designs, one for each subcortical structure, then enter these multiple designs in a single call (-d multiple times). If the designs have all identical structure (size, order of EVs, etc), varying only the EV that has the volume of a given structure, the contrasts (-t, -f, -con) can be the same for all designs. Use then the option -corrmod to correct across all contrasts and all designs.

Hope this helps!

All the best,

Anderson

 

Thank you

Regards

--VM


On Wed, Jan 4, 2017 at 3:32 AM, Anderson M. Winkler <[log in to unmask]> wrote:
Hi VM,

Please see below:

On 30 December 2016 at 23:01, neuroimage analyst <[log in to unmask]> wrote:
Hi,

I wish to compare cortical thickness across 3 groups (Control, and 2 patient groups). There are six different type of races that 3 groups belong to + gender. The 2 patient groups themselves have 2 subdivisions between them (SubGroup1 and SubGroup2). There are additional covariates of age, education, MoCA, disease score 1, disease score2, disease score 3, and ICV.

I have constructed the following design matrix and contrast matrix and will appreciate if somebody could comment if this is right.

Design Matrix:
EV1: Intercept
EV2: Controls/Group1 = -1/+1; Group2=0;
EV3: Controls/Group2 = -1/+1; Group1 = 0
EV4: Male/Female = 1/-1
EV5: RaceA/RaceB = -1/+1; Race C through F = 0;
EV6: RaceA/RaceC = -1/+1; All other races 0
EV7: RaceA/RaceD = -1/+1; All other races 0
EV8: RaceA/RaceE = -1/+1; All other races 0
EV9: RaceA/RaceF = -1/+1; All other races 0
EV10: Patient Subgroup1/Patient SubGroup 2 = -1/+1; Control =0
EV11: EV2*EV5
EV12: EV2*EV6
EV12: EV2*EV7
EV13: EV2*EV8
EV14: EV2*EV9
EV15: EV3*EV5
EV16: EV3*EV6
EV17: EV4*EV7
EV18: EV3*EV8
EV19: EV3*EV9
EV20: Age
EV21: education
EV22: EV2*EV23
EV23: EV3*EV23
EV24: MoCA for Controls; 0 for other group
EV25: MoCA for Grp1; 0 for other group
EV26: MoCA for Grp2; 0 for other group
EV27: disease score1 for Controls; 0 for other group
EV28: disease score1  for Grp1; 0 for other group
EV29: disease score1  for Grp2; 0 for other group
EV30: disease score2  for Controls; 0 for other group  
EV31: disease score2  for Grp1; 0 for other group
EV32: disease score2  for Grp2; 0 for other group
EV33: disease score3  for Controls; 0 for other group  
EV34: disease score3  for Grp1; 0 for other group
EV35: disease score3  for Grp2; 0 for other group
EV36: ICV


On a quick skim this seems right. However, you may want to split the patient subgroups (EV10) into two EVs, one for each patient group.

Another thing is that, in seeing the whole thing, it seems more logical and easier to construct the contrasts if the intercept were dropped and the 3 groups (controls, patients 1, patients 2) had each its own EV (coded as 0 and 1). The contrasts for the group comparisons can then be simple comparisons as [1 -1 0 0 ...] and so on.
 
Contrast Matrix:

a) Test if there are any differences between the groups after regressing out other effects

Grp1>Con : 0,2,1,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,0,0,0
Grp1<Con : 0,-2,-1,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,0,0,0
Grp2>Con : 0,1,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,0,0,0
Grp2<Con : 0,-1,-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,0,0,0
Grp1>Grp2 : ,0,1,-1,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,0,0,0
Grp1<Grp2 : 0,-1,1,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,0,0,0

Looks right.
 

b) Test if there are any differences due to education between the groups after regressing out other effects

education Grp1>Con : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0
education Grp1<Con : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,-1,0,0,0,0,0,0,0,0,0,0,0,0,0
education Grp2>Con : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0
education Grp2<Con : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-2,0,0,0,0,0,0,0,0,0,0,0,0,0
education Grp1>Grp2 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0
education Grp1>Grp2 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,1,0,0,0,0,0,0,0,0,0,0,0,0,0

Looks right, but education by group interaction could have been coded in the same manner as MoCA and the disease scores (as below).
 


c) Test if there are is any association between MoCA within group

MoCA Con >0 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0
MoCA Con<0 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0
MoCA Grp1  : 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,2,0,0,0,0,0,0,0,0,0,0,0
MoCA Grp1 : 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,-2,0,0,0,0,0,0,0,0,0,0,0
MoCA Grp2  : 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,2,0,0,0,0,0,0,0,0,0,0
MoCA Grp2 : 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,-2,0,0,0,0,0,0,0,0,0,0

d) Test if there are is any association between disease score 1 within group

Disease Score1 Con  : 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,2,0,0,0,0,0,0,0,0,0
Disease Score1 Con<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,-2,0,0,0,0,0,0,0,0,0
Disease Score1 Grp1 >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,2,0,0,0,0,0,0,0,0
Disease Score1 Grp1<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,-2,0,0,0,0,0,0,0,0
Disease Score1 Grp2 >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,2,0,0,0,0,0,0,0
Disease Score1 Grp2<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,-2,0,0,0,0,0,0,0

e) Test if there are is any association between disease score2  within group
Disease Score2 Con >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,2,0,0,0,0,0,0
Disease Score2 Con<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,-2,0,0,0,0,0,0
Disease Score2 Grp1 >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,0,2,0,0,0,0,0
Disease Score2 Grp1<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,0,-2,0,0,0,0,0
Disease Score2 Grp2 >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,0,0,2,0,0,0,0
Disease Score2 Grp2<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,0,0,-2,0,0,0,0

e) Test if there are is any association between disease score2  within group
Disease Score3 Con >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,0,0,0,2,0,0,0
Disease Score3 Con<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,0,0,0,-2,0,0,0
Disease Score3 Grp1 >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,0,0,0,0,2,0,0
Disease Score3 Grp1<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,0,0,0,0,-2,0,0
Disease Score3 Grp2 >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,0,0,0,0,0,2,0
Disease Score3 Grp2<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,0,0,0,0,0,-2,0

f) How to test if there are any differences due to race between the groups after regressing out other effects

Create one t-test for each of the EVs that test the race pairs (so, one contrast for each of EV5 through EV9), then an F-test that encompasses all these. This will test for any effect on any direction.
 


Questions:

1) Does the design matrix and contrast matrix makes sense? There are in total 16 controls, 40 grp1, and 140 grp2 subjects? 

Yes, although, as indicated above, it could be made simpler (or less error prone) if in this case the intercept is dropped and the 3 groups coded separately.
 

2) This is my call to PALM. Is the call correct?

palm -i bh.thickness.mgz -i bh.area.mgz -i bh.volume.mgz -i bh.cbf.mgz -d design.mat -t design.con -o bh.results -n 1000 -corrcon -corrmod -approx tail -nouncorrected -s bh.white -T -tfce2D -logp

Yes, looks right.
 

3) How to test if there are any differences due to race between the groups after regressing out other effects? -- Contrast matrix? Can I use an f test here? If yes, how should I pass the argument into PALM call above?

Yes, as indicated above. To pass the F-test use the option -f, just as you would in randomise.
 

4) With so many contrasts and using -corcon option, I am going to lose a lot of power? Can the contrast matrix be simplified to test what I want to test?

Yes, you can remove beforehand hypotheses or tests that are not relevant or meaningful, although in this case it seems all of them are plausible and presumably could be investigated.
 

5) How do I get FDR corrected p-value for the call to PALM above?

Add the option -fdr.
 

6) Since the intercept is present in the model, my understanding is I don't have to demean the regressors in the design matrix, Is that right?

Yes. And if you drop the intercept as indicated above, replacing it (and the two other group EVs) for a new set of 3 EVs, the intercept will still be present, albeit split across the 3 regressors, such that demeaning is still not necessary.

Hope this helps.

All the best,

Anderson

 

Thank you for any response. I will greatly appreciate it.

Regards and a Happy new year!

-- VM