{
  "name": "Settings that decide a permutation test result: coin, perm, lmPerm and SciPy",
  "description": "Compares four free permutation-test routes (three R packages and SciPy for Python) on the entry function, how an exact test is requested, the default resampling setting and the default p-value convention. Compiled from the CRAN reference manuals for coin 1.4-6, perm 1.0-0.4 and lmPerm 2.1.6 and the SciPy documentation, read 2026-11-17.",
  "page": "https://casrai.org/guides/permutation-test-in-r",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-17T20:35:54Z",
  "temporalCoverage": "2026",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Route",
      "unit": "",
      "description": ""
    },
    {
      "name": "Entry function",
      "unit": "",
      "description": ""
    },
    {
      "name": "How exact or Monte Carlo is requested",
      "unit": "",
      "description": ""
    },
    {
      "name": "Default resampling or stopping setting",
      "unit": "",
      "description": ""
    },
    {
      "name": "Default p-value basis",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Route": "coin (R)",
      "Entry function": "oneway_test(formula, data, ...)",
      "How exact or Monte Carlo is requested": "distribution = \"exact\" or approximate(nresample = ...); also \"asymptotic\"",
      "Default resampling or stopping setting": "nresample = 10000 for distribution = approximate()",
      "Default p-value basis": "Asymptotic approximation of the conditional distribution (distribution = \"asymptotic\")"
    },
    {
      "Route": "perm (R)",
      "Entry function": "permTS(x, y, ...) or permTS(formula, data)",
      "How exact or Monte Carlo is requested": "method = \"exact.network\", \"exact.ce\", \"exact.mc\" or \"pclt\"",
      "Default resampling or stopping setting": "nmc = 10^3 - 1 (999) in permControl(); seed 1234321 reset by default",
      "Default p-value basis": "Two-sided p-value tsmethod = \"central\": min(1, 2 * min(pless, pgreater))"
    },
    {
      "Route": "lmPerm (R)",
      "Entry function": "lmp(formula, data, perm = \"Exact\") and aovp()",
      "How exact or Monte Carlo is requested": "perm = \"Exact\", \"Prob\" or \"SPR\"; maxExact caps observations for Exact",
      "Default resampling or stopping setting": "perm = \"Prob\" stops when estimated SE of p is below Ca * p; maxIter = 1000",
      "Default p-value basis": "Permutation probabilities, as printed by the model summary"
    },
    {
      "Route": "SciPy (Python)",
      "Entry function": "scipy.stats.permutation_test(data, statistic, ...)",
      "How exact or Monte Carlo is requested": "Exact when n_resamples is at least the number of distinct permutations; otherwise randomised",
      "Default resampling or stopping setting": "n_resamples = 9999",
      "Default p-value basis": "Two-sided: twice the smaller one-sided p-value; randomised tests add one to numerator and denominator"
    }
  ],
  "sources": [
    {
      "title": "CRAN coin reference manual (1.4-6)",
      "url": "https://cran.r-project.org/web/packages/coin/coin.pdf",
      "accessed": "2026-11-17"
    },
    {
      "title": "CRAN perm reference manual (1.0-0.4)",
      "url": "https://cran.r-project.org/web/packages/perm/perm.pdf",
      "accessed": "2026-11-17"
    },
    {
      "title": "CRAN lmPerm reference manual (2.1.6)",
      "url": "https://cran.r-project.org/web/packages/lmPerm/lmPerm.pdf",
      "accessed": "2026-11-17"
    },
    {
      "title": "SciPy scipy.stats.permutation_test",
      "url": "https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.permutation_test.html",
      "accessed": "2026-11-17"
    }
  ]
}