metaUI 0.2.0
This release consolidates all changes since 0.1.1, including the unreleased 0.1.2 development versions.
Breaking changes
- Packages used only by generated apps (
clubSandwich,DT,ggplot2,meta,plotly,puniform,readxl,robumeta,shinycssloaders,shinyjs,weightr,writexl, andzcurve) moved fromImportstoSuggests.generate_shiny()checks them up front and prints the install command for any that are missing. -
generate_shiny()andbuild_app()refuse a nonempty output folder unlessoverwrite = TRUE, protecting hand edits to generated apps. Withoverwrite = TRUE, generated files (includingwww/metaui.cssandwww/metaui.js) are replaced while unrelated files are kept. - Generated apps verify their dependencies at startup and record build versions in
dependencies.csv, but no longer install packages automatically. -
prepare_data()enforces explicit effect-size and variance-scale contracts:CORrequiresvariance_scale = "r"(transformed once to Fisher’s z with delta-method variance),ZCORrequiresvariance_scale = "z"(not transformed twice), and directional bias models require an explicitdirection("positive"or"negative"). - Multilevel models nest effects within genuine per-effect IDs (
es_id, defaulting to input row numbers); display labels may repeat. Summed sample sizes are no longer inferred. - Generated apps no longer use
shinyBSorwaffle, andmetaUIno longer depends onforcats,psych, orbayesmeta. Filter help uses accessible inline disclosures, and categorical breakdowns use inline count bars. - Study-level aggregation for bias models, the opt-in Bayesian model, and combined forest-plot rows now defaults to unweighted study averages with correlated sampling variances (Borenstein et al., 2009;
metafor::aggregate.escalc(..., weighted = FALSE)) instead of inverse-covariance GLS. Choose"unweighted"(default),"gls", or"first"viaoptions = list(aggregation_method = ...)ingenerate_shiny()orbuild_app(). The legacy"aggregate"method name has been removed. - The Barroso et al. (2021) CSV (
inst/extdata/barroso2021.csv), whose redistribution terms could not be verified, has been replaced with a stub pointing to the bundled licensed examples (coles2019.csvandinst/examples/dannheim).
New features
-
Odds and risk ratios:
prepare_data()supportses_type = "OR"and"RR", from log ratios (variance_scale = "log") or 2x2 counts (counts, converted withmetafor::escalc()). Double-zero tables are excluded by default (double_zero = "exclude", following the Cochrane Handbook) or kept withdouble_zero = "keep". Models fit on the log scale; estimates, intervals, plots, equivalence bounds (x vs 1/x and x), and forest exports display ratios on log axes, while slopes, variances, and Egger’s test remain on the log scale and are labelled as such. Count columns are editable in downloaded workbooks and recomputed on upload. -
Static (serverless) website export (experimental):
generate_shiny(static_folder = ...), JSONstatic_folder, andexport_static()publish generated apps as staticshinylive/webR sites that run in the reader’s browser without a Shiny server. Precomputed Summary results appear immediately while webR loads; selection links, downloads, and mobile layout work inside the static frame;include_sources = TRUEbundles copyleft source archives for deposits such as Zenodo. Every visitor downloads the full dataset and app code, so publish only shareable material; withoverwrite = TRUE, the static site folder is deleted and rewritten. Requires the suggestedshinylivepackage. -
Headless JSON builds (
build_app()): Create apps from a versioned JSON configuration (inst/examples/config.schema.json). Schema version 2 adds alternative effect-size computations, Bayesian analysis, build-timestudy_info, and 2x2counts/double_zero; both versions supportdesign,primary_model,static_folder,eff_size_type_label,filter_popups,options, andabout. -
Author design helper (
design_app(),app_design()): Preview WCAG AA contrast-checked colour palettes, fonts (including bundled open-licensed Source Sans 3 and Source Serif 4), text size, spacing, and corner radii, and pass them viagenerate_shiny(design = ...)or JSONdesign. Apps in the default design also follow dark mode (prefers-color-scheme: darkordata-theme="dark"), including dark server-rendered plots. -
Primary model declaration: Pass
primary_modeltogenerate_shiny()or JSON configs to lead the Summary and Forest plot with the authors’ primary analysis and label other estimators as explorations. If the primary model cannot be estimated for a selection, the app reports why and never substitutes another model. -
Opt-in Bayesian analysis by grid quadrature: Enable a study-level normal-normal model (
bayesian = list(enabled = TRUE, tau_scale = ...)) with a flat mean prior, half-normal heterogeneity prior (default scale 0.5 for SMD and log OR/RR, 0.25 for Fisher’s z), posterior medians, 95% central credible intervals, and half/double prior sensitivity. Computed directly via 2,000-point grid quadrature over between-study SD (nobayesmetarequired, sub-second even at 646 studies natively and in webR, no default study cap;validation/bayesian-grid.md). -
Leave-one-out influence diagnostics: Under Outlier diagnostics, readers can inspect the average effect leaving out each study (or source, when
article_labelis provided) in turn, with changes in standard errors, flags when the CI crosses the null or the estimate crosses a chosen equivalence bound, CSV export, fast WLS updates for large selections, and automatic or on-demand full refits reporting changes in the prediction interval or τ (validation/leave-one-out.md). -
Reproducible code export: Readers can download a standalone R script or Quarto (
.qmd) file that reproduces the applied selection (filters, missing-value choices, effect computation, and equivalence bound) and Summary model rows from the downloaded workbook withoutmetaUI, recording package versions (with an optional commented-outgroundhogcall) and comparing reproduced values against the app (validation/code-export.md). -
Study details (
fetch_study_metadata(),study_info): Look up Crossref/OpenAlex metadata from DOIs at build time (with CSV caching and open-licence filtering for abstracts) or supply your own table viastudy_info. Studies in the Sample table expand to show APA-formatted references (with copy buttons), DOI links, and permitted abstracts, and readers can download selected references as.txt,.bib, or.xlsx. Generated apps never query external services. -
Alternative effect-size computations: Supply up to five author-defined computations via
prepare_data(alternatives = ...), compared on a dedicated tab with shared effect identities, provenance, and workbook/link restoration. -
Practical equivalence assessment: Readers can enter a symmetric smallest effect size of interest on the displayed scale (no default) to assess each model’s 90% interval (matching two one-sided tests at .05 for frequentist intervals, or at least 90% posterior probability within the bounds for Bayesian credible intervals; custom models can supply
LCL90andUCL90) without refitting; bounds are recorded in workbooks and shareable links. -
Shareable selection links: Short, readable, build-validated query links (
?metaui=...) restore filters, missing-value choices, computation, and equivalence bound. Links made for earlier data versions still apply as far as they fit and report what changed. -
Forest plot pagination and exports: Interactive paginated forest table (50 studies per page, expandable multi-effect studies, Find a study search, sorting by name or estimate) paired with multi-page PDF (
max_forest_plot_rows, default 60 effects per page, with plain-PDF fallback when Cairo cannot load), current-page PNG, and full CSV downloads. -
Additional authoring options:
generate_shiny()gainsoptions(intro,shiny_theme,max_forest_plot_rows,selection_list_threshold,correlation_dependent,aggregation_method,fit_cache_entries) and validates them up front.prepare_data()gainsarrange_filters,categorical_filters,es_id,counts,double_zero, and HTML entity decoding (&,–, etc.). Apps can be built without any filters or moderators. Custom model tables can supplyinterval_type,LCL90/UCL90, anddescription.
Statistical improvements
-
Unweighted study-level aggregation and GLS diagnostics: Bias models, the opt-in Bayesian model, and combined forest-plot rows default to unweighted study averages with correlated sampling variances (
options$aggregation_method = "unweighted", matchingmetafor::aggregate.escalc(..., weighted = FALSE)), avoiding negative weights and attenuation bias under within-study heterogeneity. Authors opting intooptions$aggregation_method = "gls"receive build-time warnings,validation.jsondiagnostics, and reader notes in Methods and the Forest plot whenever negative GLS weights occur. Numeric study IDs now sort numerically in the Forest plot and study search. Univariate ML/REML helpers retry once with damped Fisher scoring on convergence failure, and leave-one-out shortcuts reject trim-and-fill fits even when zero studies are imputed. -
Correlated and hierarchical effects (CHE) default multilevel model: The default multilevel model correlates sampling errors within studies at
options$correlation_dependent(default 0.6) viametafor::vcalc(), matching the within-study correlation used for study-level aggregation and RVE. Multilevel t tests use containment degrees of freedom (dfs = "contain"), and RVE uses Tipton’s (2015) small-sample correction (small = TRUE, flagging df < 4). -
One effect per study default: When every study has a single effect,
generate_shiny()defaults to a single standard random-effects model (metafor::rma.uni, REML, Hartung-Knapp interval;get_model_tibble(one_effect_per_study = TRUE)), replacing the multilevel/RVE pair and refusing uploads with multiple effects per study. Passmodels = get_model_tibble()to retain the multilevel/RVE pair. -
Dependent-effect moderator tests: Moderator models extend the primary
metafor::rma.mvmodel (or default CHE model) with cluster-robust CR2 standard errors (clubSandwich) and a fast equivalent HTZ omnibus test (sub-second on 33 categories / 2,628 effects). Single-study categories and categories below 4 small-sample df omit unstable intervals; single-study categories are excluded from the omnibus test; numeric moderators require at least three studies; one-effect-per-study selections use REML with Hartung-Knapp intervals. Missing/excluded moderator values are dropped before testing rather than tested as a level. -
Heterogeneity and prediction intervals: Intercept-only
metaformodels report 95% prediction intervals (PI_LCL,PI_UCL). Heterogeneity reports I² (using the CHE sampling covariance, split between and within studies where identified), τ, and plain caveats on Q test power and I² interpretation. -
Publication bias refinements: Generated apps use
metaforfor trim-and-fill (reporting observed-study k and imputed count, noting when filling moves estimates away from the null), funnel plots, and Egger’s test (metais only needed when author model code calls it). The Summary marks the conditional PET-PEESE estimate (Stanley & Doucouliagos, 2014; Stanley, 2017). P-curve runs on Fisher’s z for correlations and log ratios for OR/RR (effect estimation stays SMD-only and rejects negative estimates instead of flipping their sign).
Generated app interface and accessibility
-
Redesigned reader interface: Generated apps open directly on build-time precomputed results (
opening_results.rds, invalidated automatically if app files or R/model package versions change) with Update results quiet until filters change. The Summary leads with one headline sentence and draws all model intervals as diamonds on a shared axis (clipping extreme broken intervals with edge arrows so other rows stay readable). - Phone and mobile support: Filters collapse behind a toggle on phones, wide tables reflow into labelled cards, forest labels wrap, plots scale to fit, and static previews render at phone width.
-
Sample and Outlier views: Sample tables switch between one row per effect, study, or source, showing effect-size ranges rather than averages for grouped rows; breakdowns preserve author factor ordering and keep
(Missing)distinct. Outlier diagnostics show an interactive histogram with 1.5 IQR points and an accessible table of flagged effects with N, 95% CI, and z. -
Workbooks and uploads: Downloaded workbooks lead with an
instructionssheet marking Edit, Derived, Fixed, and Other columns. Uploads validate sheets and types by row, recompute derived columns (including 2x2 counts and z-scores), number added effect IDs, keep ordered factors and leading/trailing whitespace, widen full-extent ranges outward to keep added extreme values, restore saved equivalence bounds, and clear cached fits. - Accessibility: WCAG AA contrast, single top-level heading, skip link, keyboard-accessible dual-handle sliders with typed range editing, accessible names on pickers/inputs/iframes, descriptive plot alt text, and screen-reader status announcements.
Performance
- Dense vs sparse multilevel fits: Multilevel and moderator fits use dense matrices up to 250 effects (2–10x faster on small datasets natively and in webR) and sparse matrices above 250 effects (20x faster at 2,600 effects), with identical estimates.
-
Single-threaded BLAS: Generated apps set BLAS to one thread via
RhpcBLASctlwhen installed on a server (avoiding ~60x OpenBLAS contention slowdowns); build-time precomputation restores the author’s BLAS setting afterwards. - Fit caching and background tabs: Compatible fits are reused across diagnostics and cached per session (up to 3 entries for default models; 0 by default for custom models). After each update, remaining tabs pre-render one at a time in the background; moderator tests for the default selection are saved at build time.
-
P-curve deduplication: Identical noncentrality solves in
pcurve()are deduplicated without changing results.
Bug fixes
- Fixed
prepare_data()handling ofna.rm = TRUE(ignores unmapped columns),arrange_filters = "alphabetical"(sorts by label),NULLoptional mapping arguments (url,article_label,es_label), DOI prefix/whitespace normalisation, and non-ASCII/punctuation filter labels. - Fixed
se.from.p()handling ofNAinputs and inverted CIs for negative effect sizes,pcurve()restoration of graphicalpar(mar)and global options, andmetaUI_parse_crossref()/metaUI_normalise_doi()edge cases. - Fixed
create_about()handling of customlist_packagescharacter vectors (including 1–2 packages) andNULLmetadata fields, added input guards ingenerate_shiny(), and handled equal-SE selections cleanly in Egger’s test. - Fixed
to_tribble()round-tripping of backslashes and quotes in custom model code, and eliminated temporary-file leaks in code export and app warm-up. - Fixed forest PDF clipping of top summary diamonds, non-converging funnel/Egger error handling, single-effect and empty-selection messaging, double-escaping on the leave-one-out refit button, and Reset behaviour after uploads.
- Corrected the
Effect computationscomparison table formatting to match the Summary and Bayesian sensitivity tables.
Examples and testing
- Added the CC-BY-4.0 Dannheim et al. (2025) mental-health example (
inst/examples/dannheim) with a verified source-reference REML/Hartung-Knapp model, a synthetic correlation example (inst/examples/correlations), and updatedinst/extdata/coles2019.csvwith thepaqoutcome-type column. - Expanded automated tests to over 2,600 assertions covering statistical contracts against
metafor, headless server tests, static export, and Chromium browser smoke checks on Linux, macOS, and Windows.
metaUI 0.1.1
- Fixed issue where k was not displayed for moderators with spaces in names
- Simplified implementation of
generate_shiny()- it is now always saved, either to provided path or to temporary files, and launched from file. This should increase robustness. Also, removed unnecessaryapp.Rso thatglobals.Rdoes not need to be called explicitly. - Added a
NEWS.mdfile to track changes to the package. - Added explicit option to include or exclude NAs on filters and report NA share in Sample descriptives
- Added
Resetbutton to reset all filters - Added option to add popups to filter, by specifying
filter_popupsingenerate_shiny()
