jaromilfrossard / permuco

R package for permutation test in linear model with nuisances variables
https://jaromilfrossard.github.io/permuco/
11 stars 2 forks source link

clusterlm for segmented white matter tracts #13

Closed TeddyTuresky closed 1 year ago

TeddyTuresky commented 1 year ago

Hello and thank you for providing this tool!

I was hoping to perform correction for multiple comparisons on white matter tracts we reconstructed using pyAFQ (https://github.com/yeatmanlab/pyAFQ). The tracts are divided into ~100 segments and we have applied linear regression models to each segment separately. In the past, when AFQ was Matlab-based, we used this script (https://github.com/yeatmanlab/AFQ/blob/master/functions/AFQ_MultiCompCorrection.m), which also relies on permutation, to generate minimum cluster size estimates for cluster-wise FWE correction. However, we're trying to use more open source tools and I was wondering whether clusterlm would also work.

I tried to run it on some data using clusterlm(big_mat_brain_r0 ~ beh, dat_id_beh) variables: big_mat_brain_r0: a dataframe in which each white matter segment is a column (98 segments/columns in this case) dat_id_beh: a dataframe containing one behavioral measure of interest (i.e., beh)

It generated the following:

Effect: beh. Alternative Hypothesis: two.sided. Statistic: fisher(1, 36). Resampling Method: freedman_lane. Type of Resampling: permutation. Number of Dependant Variables: 98. Number of Resamples: 5000. Multiple Comparisons Procedure: clustermass. Threshold: 4.113165. Mass Function: the sum. Table of clusters.

start end cluster mass P(>mass) 1 51 86 218.3468 0.0252

My understanding of this is that it's not so much generating a minimum cluster size, but estimating cluster-wise p-values for any clusters of segments that are significant at an uncorrected threshold (looks like p=0.05), is this correct?

Many thanks! Teddy

jaromilfrossard commented 1 year ago

Dear Teddy,

Thank you for using permuco.

By default the clusterlm() function perform the "cluster mass test". I am not familiar with "minimum cluster size estimates" but I believe it is not related. You can find more references on the cluster mass test an other multiples comparaison procedures implemented in permuco in the vignette: https://jaromilfrossard.github.io/permuco/articles/citing-permutation-test.html

Kind regards,

Jaromil