{
  "name": "Where the p-value is stored in common R test and model objects",
  "description": "Compiled from the official R manual pages for t.test, cor.test, summary.lm, pairwise.t.test and p.adjust. For each function it records the returned object type, where the p-value is stored, the default alternative and the adjustment or exact-test rule the manual states.",
  "page": "https://casrai.org/guides/p-value-in-r",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T22:02:47Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "Returned object",
      "unit": "",
      "description": ""
    },
    {
      "name": "Where the p-value is",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented default or rule",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Function": "t.test",
      "Returned object": "list of class htest",
      "Where the p-value is": "$p.value",
      "Documented default or rule": "alternative = two.sided; var.equal = FALSE (Welch); paired = FALSE"
    },
    {
      "Function": "cor.test",
      "Returned object": "list of class htest",
      "Where the p-value is": "$p.value",
      "Documented default or rule": "method pearson/kendall/spearman; Kendall exact if fewer than 50 finite pairs and no ties; Spearman AS 89 for n below 1290 with exact = TRUE, otherwise asymptotic t approximation"
    },
    {
      "Function": "summary.lm",
      "Returned object": "summary object",
      "Where the p-value is": "coefficients matrix, column 4 (two-sided; extract with coef())",
      "Documented default or rule": "F test stored as fstatistic (value, numdf, dendf), not as a p-value"
    },
    {
      "Function": "pairwise.t.test",
      "Returned object": "pairwise.htest",
      "Where the p-value is": "Matrix of adjusted p-values for each pair",
      "Documented default or rule": "p.adjust.method defaults to the first entry of p.adjust.methods (holm)"
    },
    {
      "Function": "p.adjust",
      "Returned object": "numeric vector, names copied",
      "Where the p-value is": "Returned vector is the adjusted p-values",
      "Documented default or rule": "Methods: holm, hochberg, hommel, bonferroni, BH, BY, fdr, none; n = length(p) by default"
    }
  ],
  "sources": [
    {
      "title": "R manual: t.test",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/t.test.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R manual: cor.test",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/cor.test.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R manual: summary.lm",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/summary.lm.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R manual: pairwise.t.test",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/pairwise.t.test.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R manual: p.adjust",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html",
      "accessed": "2026-11-14"
    }
  ]
}