| clusterlm | R Documentation |
Compute the cluster-mass test for longitudinal linear model.
clusterlm(
formula,
data = NULL,
np = 5000,
method = NULL,
type = "permutation",
test = "fisher",
threshold = NULL,
aggr_FUN = NULL,
multcomp = "clustermass",
...
)
formula |
A formula object where the left part is a matrix defined in the global environment. |
data |
A data frame for the independent variables. |
np |
The number of permutations. Default value is |
method |
A character string indicating the method used to handle nuisance variables. Default is |
type |
A character string to specify the type of transformations: "permutation" and "signflip" are available. Is overridden if P is given. See help from Pmat. |
test |
A character string to specify the name of the test. Default is |
threshold |
A numerical value that specify the threshold for the |
aggr_FUN |
A function used as mass function. It should aggregate the statistics of a cluster into one scalar. Default is the sum of squares fot t statistic and sum for F statistic. |
multcomp |
A vector of character defining the methods of multiple comparisons to compute. Default is |
... |
Futher arguments, see details. |
The random effects model is only available with a F statistic.
Other arguments could be pass in ... :
P : A matrix containing the permutation of class matrix or Pmat; which is used for the reproducibility of the results. The first column must be the identity. P overwrites np argument.
rnd_rotation : A matrix of random value to compute a rotation of size n \times n that will be used for the "huh_jhun" method.
p_scale = FALSE : if set to TRUE, the several multiple comparisons procedures are compute on the 1 - p scale, where p is the p-value. The threshold have to be set between 0 and 1 (eg: threshold = 0.95). The function aggr_FUN should be big when there is evidence against the null (eg: aggr_FUN = function(p)sum(abs(log(1-p))). Moreover under the probability scale the cluster mass statistics is sensitive to the number permutations.
H, E, ndh : the parameters used for the "tfce" method. Default values are set to H = 2 for the height parameter, to E = 0.5 for the extend parameter and to ndh = 500 for the number terms to approximate the integral.
alpha = 0.05 : the type I error rate. Used for the troendle multiple comparisons procedure.
return_distribution = FALSE : return the permutation distribution of the statistics. Warnings : return one high dimensional matrices (number of test times number of permutation) for each test.
coding_sum : a logical defining the coding of the design matrix to contr.sum: set by default to TRUE for ANOVA (when the argument test is "fisher" ) to tests main effects and is set to FALSE when test is "t". If coding_sum is set to FALSE the design matrix is computed with the coding defined in the dataframe and the tests of simple effets are possible with a coding of the dataframe set to contr.treatment.
A clusterlm object. Use the plot.clusterlm or summary.clusterlm method to see results of the tests.
jaromil.frossard@unige.ch
Maris, E., & Oostenveld, R. (2007). Nonparametric statistical testing of EEG-and MEG-data. Journal of neuroscience methods, 164(1), 177-190.
Smith, S. M., & Nichols, T. E. (2009). Threshold-free cluster enhancement: addressing problems of smoothing, threshold dependence and localisation in cluster inference. Neuroimage, 44(1), 83-98.
plot.clusterlm summary.clusterlm
Other main function:
aovperm(),
lmperm()
## Cluster-mass for repeated measures ANOVA
## Warning : np argument must be greater (recommendation: np >= 5000)
electrod_O1 <- clusterlm(attentionshifting_signal ~ visibility*emotion*direction
+ Error(id/(visibility*emotion*direction)), data = attentionshifting_design,
np = 50)
## Results
plot(electrod_O1)
## Results with labels on the x axis that represent seconds from time-locked event:
plot(electrod_O1, nbbaselinepts = 200, nbptsperunit = 1024)
## Tables of clusters
electrod_O1
## Not run:
## Change the function of the aggregation
## Sum of squares of F statistics
electrod_O1_sum <- clusterlm(attentionshifting_signal ~ visibility*emotion*direction
+ Error(id/(visibility*emotion*direction)), data = attentionshifting_design,
aggr_FUN = function(x)sum(x^2))
## Length of the cluster
electrod_O1_length <- clusterlm(attentionshifting_signal ~ visibility*emotion*direction
+ Error(id/(visibility*emotion*direction)), data = attentionshifting_design,
aggr_FUN = function(x)length(x))
## All multiple comparisons procedures for repeated measures ANOVA
## Permutation method "Rde_kheradPajouh_renaud"
full_electrod_O1 <- clusterlm(attentionshifting_signal ~ visibility*emotion*direction
+ Error(id/(visibility*emotion*direction)), data = attentionshifting_design,
method = "Rde_kheradPajouh_renaud", multcomp = c("troendle", "tfce",
"clustermass", "bonferroni", "holm", "benjamini_hochberg"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.