if (!exists("meta") || is.null(meta)) meta <- packageDescription("BUCSS")
year <- sub("-.*", "", meta$Date)
# Fall back to the release year, not the reader's current year, so the package
# citation stays stable after 2026; update alongside the next release.
if (length(year) == 0L || is.na(year) || !nzchar(year)) year <- "2026"
note <- sprintf("R package version %s", meta$Version)

citHeader(
  "To cite BUCSS in publications, please cite the package itself, so that the ",
  "specific version and its CRAN source are credited, together with the ",
  "methodological article(s) on which the analysis you report relies. Anderson, ",
  "Kelley, and Maxwell (2017, Psychological Science) introduces the method; ",
  "Anderson and Maxwell (2017, Multivariate Behavioral Research) gives a more ",
  "technical treatment for replication; Anderson (2021, Psychological Methods) ",
  "is a tutorial for the regression designs; and Anderson and Kelley (2024, ",
  "Psychological Methods) extends the approach to the design of replication ",
  "studies."
)

bibentry(
  bibtype  = "Manual",
  title    = "{BUCSS}: Bias and Uncertainty Corrected Sample Size",
  author   = c(person("Ken", "Kelley"),
               person("Samantha F.", "Anderson"),
               person("Scott E.", "Maxwell")),
  year     = year,
  note     = note,
  url      = "https://CRAN.R-project.org/package=BUCSS"
)

bibentry(
  bibtype = "Article",
  title   = paste("Sample-size planning for more accurate statistical power:",
                  "A method adjusting sample effect sizes for publication bias",
                  "and uncertainty"),
  author  = c(person("Samantha F.", "Anderson"),
              person("Ken", "Kelley"),
              person("Scott E.", "Maxwell")),
  journal = "Psychological Science",
  year    = "2017",
  volume  = "28",
  number  = "11",
  pages   = "1547--1562",
  doi     = "10.1177/0956797617723724"
)

bibentry(
  bibtype = "Article",
  title   = paste("Addressing the \"replication crisis\": Using original studies",
                  "to design replication studies with appropriate statistical",
                  "power"),
  author  = c(person("Samantha F.", "Anderson"),
              person("Scott E.", "Maxwell")),
  journal = "Multivariate Behavioral Research",
  year    = "2017",
  volume  = "52",
  number  = "3",
  pages   = "305--324",
  doi     = "10.1080/00273171.2017.1289361"
)

bibentry(
  bibtype = "Article",
  title   = paste("Using prior information to plan appropriately powered",
                  "regression studies: A tutorial using BUCSS"),
  author  = person("Samantha F.", "Anderson"),
  journal = "Psychological Methods",
  year    = "2021",
  volume  = "26",
  number  = "5",
  pages   = "513--526",
  doi     = "10.1037/met0000366"
)

bibentry(
  bibtype = "Article",
  title   = "Sample size planning for replication studies: The devil is in the design",
  author  = c(person("Samantha F.", "Anderson"),
              person("Ken", "Kelley")),
  journal = "Psychological Methods",
  year    = "2024",
  volume  = "29",
  number  = "5",
  pages   = "844--867",
  doi     = "10.1037/met0000520"
)
