ptestR - Permutation-Based Significance Testing for Regression Models
Wraps glm(), lme4::lmer(), and binomial glm() with a
permutation loop to compute nonparametric p-values. For each
model, ptestR generates a null distribution of the test
statistic by randomly rearranging the outcome variable, then
computes p.perm as the proportion of permuted statistics at
least as extreme as the observed one. This approach requires
far fewer distributional assumptions than standard Wald or
likelihood-ratio tests, making it well-suited to neuroimaging,
EEG, and other biomedical datasets with repeated measures and
small samples.