Print

Print


Hi VM,

Thanks for letting me know. The bug can be fixed, although it's probably better to simply drop the -saveparametric option. It's seldom useful and will likely be removed in a future version.

The -zstat option was added automatically because the correction involves both t and F contrasts (more specifically, it involves contrasts with different ranks).

Hope this helps.

All the best,

Anderson


On 8 January 2017 at 00:43, neuroimage analyst <[log in to unmask]> wrote:
Thank you, Anderson.

I ran the follwoing line: 
palm -i bh_volume_con_s.15.mgz -i bh_cbf_con_s.15.mgz -i bh_thickness_con_s.15.mgz -s bh.white -d design_matrix_con_vs_s.mat -t contrast_matrix_con_vs_s.con -f f_contrast_matrix_con_vs_s.fts -o /media/sf_M_DRIVE/subjects/palm_stats/Con_vs_s/bh.results -n 100 -corrcon -approx tail -T -tfce2D -logp -fdr -npc -saveparametric -Tnpc -nouncorrected -corrmod

After running for 2 days the script showed an error in saving the p-values:

Computing p-values.
Saving p-values (uncorrected, and corrected within modality and within contrast).
Saving file: /media/sf_M_DRIVE/subjects/palm_stats/Con_vs_s/bh.results_dpv_ztstat_fwep_m1_c1
Saving file: /media/sf_M_DRIVE/subjects/palm_stats/Con_vs_s/bh.results_dpv_ztstat_fdrp_m1_c1
Saving file: /media/sf_M_DRIVE/subjects/palm_stats/Con_vs_s/bh.results_tfce_ztstat_m1_c1
Saving file: /media/sf_M_DRIVE/subjects/palm_stats/Con_vs_s/bh.results_tfce_ztstat_fwep_m1_c1
Saving file: /media/sf_M_DRIVE/subjects/palm_stats/Con_vs_s/bh.results_tfce_ztstat_fdrp_m1_c1

Undefined function or variable 'P'.

Error in palm_saveall (line 323)
                        palm_quicksave(fastfdr(P),1,opts,plm,y,m,c, ...

Error in palm_core (line 2474)
palm_saveall(plm,opts);

Error in palm (line 81)
palm_core(varargin{:});


It appears the error happened during computing fdr p-values. Would you know why would that error occur? 


Second, as you can see I didnt invoke zstat but the results are "*_ztstat*'. Would you know why?

Thanks

Regards

-VM

On Sat, Jan 7, 2017 at 4:04 AM, Anderson M. Winkler <[log in to unmask]> wrote:
Hi VM,

So there is some overlap... group1 + group2 = subtype1 + subtype 2. The controls aren't part of this set. To get around the rank deficiency, leave EV10 without any splitting (i.e., coded as 0 for controls and +1/-1 for the two subtypes).

All the best,

Anderson
 

On 6 January 2017 at 14:42, neuroimage analyst <[log in to unmask]> wrote:
Hi Anderson.

Thanks.

There are total of 155 patients which are classified into 60 as group 1 and 95 as group 2. Out of these total 155 patients, 43 are subtype1 and remaining as subtype2. There isn't a perfect overlap among the patient subgroups. 

The EV for the design matrix has 170 rows. The way I code is EVx = 1 for subtype1 ( total 43) 0 for all othrs and 1 for subtype2 ( total 112) 0 for all others. I was thinking to create just 1 EV with 0 for controls, 1 for subtype1 and -1 for subtype2. Is this coding not right?

Thanks 
Regards 
-VM


On Jan 6, 2017 4:01 AM, "Anderson M. Winkler" <[log in to unmask]> wrote:
Hi VM,

Who are the patients? Are these the same as Group1 or Group2, or both? How does Patient Subgroups 1 and 2 differ from Groups 1 and 2? There may be some perfect overlap between some of these groups/subgroups...

All the best,

Anderson


On 6 January 2017 at 05:12, neuroimage analyst <[log in to unmask]> wrote:
Hi Anderson.

I forgot to ask this question. If I split EV 10 below into 2 EVs as

EV 10: patient subgroup 1; controls and patient subgroup 2 =0
EV11: patient subgroup 2 =1; controls and patient subgroup 1 =0 

Then it will make the matrix rank deficient. What is the best way to code them without making the matrix rank deficient? 

Thanks

Regards   

-VM

On Jan 4, 2017 3:34 AM, "AndersoM. 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