Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/namakala/inappropriate-acid-suppressor-agent-use/llms.txt

Use this file to discover all available pages before exploring further.

The Quarto report (docs/report.qmd) is generated automatically as the final step of the targets pipeline via a tar_quarto() target. It loads all upstream model objects using targets::tar_load() and targets::tar_read(), then renders a complete PDF containing executive summary, methods, results, and appendix sections. You do not need to render the report manually; running targets::tar_make() will produce it after all model targets are complete.

Report structure

The report is organized into four top-level sections: Executive Summary A narrative overview of the main findings: overall pooled prevalence, heterogeneity, robustness to publication bias, and key drivers of variability. Methods
  • Data Processing and Variable Standardization
  • Pooled Prevalence Estimation — random effects, Freeman-Tukey transformation, REML, Hartung-Knapp adjustment
  • Heterogeneity Assessment — I², τ², H, Wald’s Q; subgroup analyses and meta-regression
  • Publication Bias and Sensitivity Analysis — contour-enhanced funnel plots, Copas selection model
  • Software and Reproducibility — R 4.5.1, targets, tarchetypes, crew
Results
  • Overall Prevalence of Inappropriate Use
  • Heterogeneity
  • Publication Bias and Small Study Effects
  • Subgroup Analyses: Age, Continent, Study Quality, Clinical Setting
  • Meta-Regression
Appendix
  • Interpretation Notes — guidance on Doi plot vs. funnel plot choice, Copas model rationale, and further reading
  • Full model outputs (summary, funnel/Doi plots, Copas model)
  • Subgroup model outputs (iterated over all mod_subgroup_* targets)
  • Meta-regression outputs (univariable and multivariable)

Output formats

The report is configured in docs/report.qmd with format: pdf and keep-md: true:
format:
  pdf:
    keep-md: true
This produces two output files:
  • docs/report.pdf — the primary rendered report for distribution and review
  • docs/report.pdf.md — a Markdown copy retained for inspection, diffing, and programmatic access to rendered text

Running the report independently

If you need to re-render the report without re-running all upstream targets (for example, after editing prose in report.qmd), use:
targets::tar_make(names = "report")
This re-renders only the report target. All upstream model targets (mod_prop, mod_copas_prop, subgroup models, meta-regression models) must already be computed and stored in the _targets/ cache.
The report uses targets::tar_load() and targets::tar_read() throughout to access pipeline results. All upstream targets must be computed and available in the cache before rendering; otherwise the report will fail with a missing-object error.

Key helper functions

Three helper functions defined in the {r helper-functions} chunk power the report’s narrative output.

printSummary(mod)

Prints a formatted summary of a meta-analysis model: pooled prevalence on the probability scale with 95% CI, number of studies, total observations, total events, and all heterogeneity measures.
printSummary <- function(mod, detail = FALSE) {
  require("meta")

  harmonic_n <- {1 / mean(1 / mod$n)}

  msg_hetero <- c("$\\tau^2$: %.3f", "$I^2$: %.2f%%", "$H$: %.2f", "Wald's $Q$: %s\n\n") |>
    paste(collapse = "\n- ")

  res <- summary(mod)

  catf(
    "**%s: %.3f [%.3f, %.3f]**  \n",
    res$text.random,
    pft2p(res$TE.random,    n = mod$n),
    pft2p(res$lower.random, n = mod$n),
    pft2p(res$upper.random, n = mod$n)
  )
  catf("Number of studies: %d  \n", res$k)
  catf("Number of observations: %s  \n", prettyNum(sum(res$n), big.mark = ","))
  catf("Number of events: %s  \n\n", prettyNum(sum(res$event), big.mark = ","))
  cat("Heterogeneity measures:\n\n")
  catf(
    paste("-", msg_hetero),
    res$tau2,
    res$I2 * 100,
    res$H,
    prettyNum(res$Q[[1]], big.mark = ",")
  )
  if (detail) {
    cat(getMetaDetails(mod))
  }
}

pft2p(x, n)

Back-transforms a Freeman-Tukey double arcsine estimate to the probability scale using the harmonic mean of the sample sizes. This is required because the meta-analysis is fitted on the transformed scale.
pft2p <- function(x, n) {
  harmonic_n <- {1 / mean(1 / n)}
  p <- meta::backtransf(x, sm = "PFT", n = harmonic_n)
  return(p)
}

getMetaDetails(meta_object)

Captures and formats the output of meta:::catmeth() for a given model object. When detail = TRUE is passed to printSummary(), this function appends a structured description of the model settings including estimator, transformation, and confidence interval method.
getMetaDetails <- function(meta_object) {
  msg <- capture.output(
    meta:::catmeth(
      meta_object,
      common          = TRUE,
      random          = TRUE,
      print.tau2      = TRUE,
      overall         = TRUE,
      overall.hetstat = TRUE,
      backtransf      = FALSE,
      prediction      = FALSE,
      print.tau2.ci   = TRUE,
      print.I2        = FALSE,
      func.transf     = meta_object$func.transf,
      func.backtransf = meta_object$func.backtransf,
      big.mark        = ",",
      digits          = 3,
      digits.tau      = 3,
      text.tau        = "$\\tau$",
      text.tau2       = "$\\tau^2$",
      text.I2         = "$I^2$"
    )
  )

  clean_msg <- msg[-1] %>%
    {gsub(x = ., ":$", ":\n\n")} |>
    paste(collapse = "\n")

  return(clean_msg)
}

Reproducibility

All analyses use seed <- 1810, set in _targets.R, to ensure that any stochastic steps produce identical results across runs. The complete computational environment — R version, package versions, and dependency graph — is captured in renv.lock. To restore the exact environment used to produce the report:
renv::restore()

Build docs developers (and LLMs) love