permu.test {permutes} | R Documentation |
Permutation tests for time series data, based on classic linear regression or ANOVA
This is a legacy function that is primarily provided for backward compatibility. You should probably use perm.lm
or perm.lmer
instead.
permu.test
is the only function to support multivariate responses, although multivariate data can trivially be recoded into a univariate model.
permu.test
does not support random effects or corrected p-values (e.g. the cluster mass test), which are supported by permutelm
.
Description
Permutation tests for time series data, based on classic linear regression or ANOVA
This is a legacy function that is primarily provided for backward compatibility. You should probably use perm.lm
or perm.lmer
instead.
permu.test
is the only function to support multivariate responses, although multivariate data can trivially be recoded into a univariate model.
permu.test
does not support random effects or corrected p-values (e.g. the cluster mass test), which are supported by permutelm
.
Usage
permu.test(
formula,
data,
subset = NULL,
type = "anova",
parallel = FALSE,
progress = "text",
...
)
Arguments
formula |
A formula of the following form: |
data |
The dataset referencing these predictors. |
subset |
If specified, will only analyze the specified subset of the data. |
type |
A character string of either |
parallel |
Whether to parallelize the permutation testing using plyr's |
progress |
A plyr |
... |
Other arguments to be passed to |
Value
A data frame.
See Also
clusterperm.lm
, clusterperm.lmer
Examples
# EEG data example using the MMN dataset
# Run permutation tests on all electrodes and timepoints, reporting p-values for the three
# manipulated factors
perms <- permu.test(cbind(Fp1,AF3,F7,F3,FC1,FC5,C3,CP1,CP5,P7,P3,Pz,PO3,O1,Oz,O2,PO4,P4,
P8,CP6,CP2,C4,FC6,FC2,F4,F8,AF4,Fp2,Fz,Cz) ~ Deviant * Session | Time,data=MMN)
# Run the tests in parallel on two CPU threads
# first, set up the parallel backend
library(doParallel)
cl <- makeCluster(2)
registerDoParallel(cl)
perms <- permu.test(cbind(Fp1,AF3,F7,F3,FC1,FC5,C3,CP1,CP5,P7,P3,Pz,PO3,O1,Oz,O2,PO4,P4,
P8,CP6,CP2,C4,FC6,FC2,F4,F8,AF4,Fp2,Fz,Cz) ~ Deviant * Session | Time,data=MMN,
parallel=TRUE)
stopCluster(cl)
# Plot the results by F-value, removing points that were not significant in the
# permutation tests
plot(perms,sig='p')
# t-values instead of F-values
perms <- permu.test(cbind(Fp1,AF3,F7,F3,FC1,FC5,C3,CP1,CP5,P7,P3,Pz,PO3,O1,Oz,O2,PO4,P4,
P8,CP6,CP2,C4,FC6,FC2,F4,F8,AF4,Fp2,Fz,Cz) ~ Deviant * Session | Time,data=MMN,
type='regression')