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.
clean.R contains a single function that takes the raw tibble from readData() and produces a standardized data frame ready for fitMetaprop(), fitSubMetaprop(), fitMetareg(), and applyCopas(). It renames columns, coerces types, classifies categorical variables, and computes the logit-prevalence outcome and its variance.
clean()
Parameters
Raw study-level data frame as returned by
readData(). Must contain the original column names from the CSV: Patient's age, Year of Publication, Prevalence, Sample size, Inappropriate indication, Continent, Setting, and Guideline.Additional arguments. Currently unused; reserved for future extensibility.
Returns
A data frame with standardized, R-compatible column names. All column names are passed throughmake.names() as a final step, replacing spaces and special characters with dots.
Transformations
| Output column | Source column | Operation |
|---|---|---|
Age | Patient's age | Renamed; type unchanged |
Year | Year of Publication | Coerced to integer |
Prevalence | Prevalence | Comma replaced with dot, coerced to numeric |
Sample_size | Sample size | Coerced to integer |
Inappropriate_indication | Inappropriate indication | Coerced to integer |
Continent | Continent | Fuzzy-matched with grepl into four levels: "North America", "Asia", "Europe", "Other"; stored as ordered factor |
Setting | Setting | Dichotomized: rows matching "Hospital" → "Hospital Setting", all others → "Other"; stored as factor |
use_guideline | Guideline | "Yes" → "Followed Guideline(s)", all others → "No Guideline" |
logit_prevalence | Prevalence | Computed as log(Prevalence / (1 - Prevalence)) |
var_logit_prevalence | Sample_size, logit_prevalence | Computed as 1 / (Sample_size * logit_prevalence) |
Usage
_targets.R:
