R 패키지 메타데이터와 수집 신호를 모아 봅니다.
첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.
DESCRIPTION에서 감지한 backend 관련 package입니다.
기본 메타데이터를 작은 카드와 토큰으로 압축합니다.
BH (>= 1.66.0)Rcpp (>= 0.12.0)RcppEigen (>= 0.3.3.3.0)RcppParallel (>= 5.0.1)rstan (>= 2.26.0)StanHeaders (>=
2.26.0)| Package | Type | Spec |
|---|---|---|
| dplyr CRAN · 0.3.2 · 2026-05-30 | Imports | dplyr |
| generics CRAN · 0.3.2 · 2026-05-30 | Imports | generics |
| ggplot2 CRAN · 0.3.2 · 2026-05-30 | Imports | ggplot2 |
| glue CRAN · 0.3.2 · 2026-05-30 | Imports | glue |
| lifecycle CRAN · 0.3.2 · 2026-05-30 | Imports | lifecycle |
| magrittr CRAN · 0.3.2 · 2026-05-30 | Imports | magrittr |
| methods CRAN · 0.3.2 · 2026-05-30 | Imports | methods |
| Rcpp CRAN · 0.3.2 · 2026-05-30 | Imports | Rcpp (>= 0.12.0) |
| RcppParallel CRAN · 0.3.2 · 2026-05-30 | Imports | RcppParallel (>= 5.0.1) |
| rlang CRAN · 0.3.2 · 2026-05-30 | Imports | rlang |
| rstan CRAN · 0.3.2 · 2026-05-30 | Imports | rstan (>= 2.26.0) |
| rstantools CRAN · 0.3.2 · 2026-05-30 | Imports | rstantools (>= 2.5.0) |
| scales CRAN · 0.3.2 · 2026-05-30 | Imports | scales |
| tidybayes CRAN · 0.3.2 · 2026-05-30 | Imports | tidybayes |
| tidyr CRAN · 0.3.2 · 2026-05-30 | Imports | tidyr |
| BH CRAN · 0.3.2 · 2026-05-30 | LinkingTo | BH (>= 1.66.0) |
| Rcpp CRAN · 0.3.2 · 2026-05-30 | LinkingTo | Rcpp (>= 0.12.0) |
| RcppEigen CRAN · 0.3.2 · 2026-05-30 | LinkingTo | RcppEigen (>= 0.3.3.3.0) |
| RcppParallel CRAN · 0.3.2 · 2026-05-30 | LinkingTo | RcppParallel (>= 5.0.1) |
| rstan CRAN · 0.3.2 · 2026-05-30 | LinkingTo | rstan (>= 2.26.0) |
| StanHeaders CRAN · 0.3.2 · 2026-05-30 | LinkingTo | StanHeaders (>= 2.26.0) |
| bayesplot CRAN · 0.3.2 · 2026-05-30 | Suggests | bayesplot |
| covr CRAN · 0.3.2 · 2026-05-30 | Suggests | covr |
| knitr CRAN · 0.3.2 · 2026-05-30 | Suggests | knitr |
| latex2exp CRAN · 0.3.2 · 2026-05-30 | Suggests | latex2exp |
| posterior CRAN · 0.3.2 · 2026-05-30 | Suggests | posterior |
| progress CRAN · 0.3.2 · 2026-05-30 | Suggests | progress |
| rmarkdown CRAN · 0.3.2 · 2026-05-30 | Suggests | rmarkdown |
| stringr CRAN · 0.3.2 · 2026-05-30 | Suggests | stringr |
| testthat CRAN · 0.3.2 · 2026-05-30 | Suggests | testthat (>= 3.0.0) |
| 검색 결과가 없습니다. | ||
| Package | Type | Spec |
|---|---|---|
| 표시할 dependency edge가 없습니다. | ||
| 검색 결과가 없습니다. | ||
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} bennu 0.3.2 Fix stringr issue in tests (#44) bennu 0.3.1 Plan to release simplified version of regression model est_naloxone can accept priors to change the default model priors (#38) plot_kit_use can accept reported to plot reported kits used with the posterior predictive distribution (#34) kit_summary_table changed to provide sum estimates by grouped variables as opposed to the percentiles within each group kit_summary_table can accept empty ... to provide overall summary not grouped by variables bennu 0.3.0 kit_summary_table created to provide a quick way of summarizing model output by different strata model_random_walk_data created to more closely mimic Bayesian data generating process generate_model_data deprecated as model_random_walk_data will supplant it as way of generating simulation data to test properties of the model Updates to stan model to make it compliant to rstan 2.26 (#22) bennu 0.2.1 bennu 0.2.0 bennu 0.1.0 est_naloxone can accept psi_vector of variable length and additionally accepts delay_alpha and delay_beta (#12). est_naloxone can accept missing values for Reported_Distributed and Reported_Used columns (#6). bennu 0.0.0.9000 Added a NEWS.md file to track changes to the package.README code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ bennu B ayesian E stimation of N aloxone N umbers U nderreporting ( BENNU ) The package name comes from the Welsh word for “to finish” (pronounced benn-y) An R package 📦 for generating estimates of total naloxone kit numbers distributed and used from naloxone kit orders data. Installation You can install the released version of bennu from CRAN with: install.packages ( "bennu" ) And the development version from GitHub with: # install.packages("devtools") devtools :: install_github ( "sempwn/bennu" ) Example This example runs output for test data generated by the package: library (bennu) library (rstan) #> Loading required package: StanHeaders #> #> rstan version 2.32.7 (Stan version 2.32.2) #> For execution on a local, multicore CPU with excess RAM we recommend calling #> options(mc.cores = parallel::detectCores()). #> To avoid recompilation of unchanged Stan programs, we recommend calling #> rstan_options(auto_write = TRUE) #> For within-chain threading using `reduce_sum()` or `map_rect()` Stan functions, #> change `threads_per_chain` option: #> rstan_options(threads_per_chain = 1) library (bayesplot) #> This is bayesplot version 1.14.0 #> - Online documentation and vignettes at mc-stan.org/bayesplot #> - bayesplot theme set to bayesplot::theme_default() #> * Does _not_ affect other ggplot2 plots #> * See ?bayesplot_theme_set for details on theme setting rstan_options ( auto_write = TRUE ) options ( mc.cores = parallel :: detectCores ( logical = FALSE )) ## basic example code d <- generate_model_data () # note iter should be at least 2000 to generate a reasonable posterior sample fit <- est_naloxone (d, iter= 500 ) mcmc_pairs (fit, pars = c ( "sigma" , "mu0" , "zeta" ), off_diag_args = list ( size = 1 , alpha = 0.5 )) An overall summary of the model output can also be provided as a data frame kit_summary_table (fit, data = d) #> # A tibble: 1 × 6 #> Probability of kit use if dist…¹ Estimated as distrib…² Proportion kits dist…³ #> <glue> <glue> <glue> #> 1 64.97% (95% CrI: 12.93% - 96.79… 24,907.00 (95% CrI: 2… 21.03% (95% CrI: 20.8… #> # ℹ abbreviated names: ¹`Probability of kit use if distributed`, #> # ²`Estimated as distributed`, #> # ³`Proportion kits distributed that are reported` #> # ℹ 3 more variables: `Estimated kits used` <glue>, #> # `Proportion kits used that are reported` <glue>, #> # `Proportion kits ordered that are used` <glue> Getting help If you encounter a clear bug, please file an issue with a minimal reproducible example on GitHub .Help for package bennu const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {bennu} Contents bennu-package %>% est_naloxone est_naloxone_vec experimental_validation_data generate_model_data kit_summary_table missing_data_validation model_random_walk_data plot_kit_use Title: Bayesian Estimation of Naloxone Kit Number Under-Reporting Version: 0.3.2 Description: Bayesian model and associated tools for generating estimates of total naloxone kit numbers distributed and used from naloxone kit orders data. Provides functions for generating simulated data of naloxone kit use and functions for generating samples from the posterior. License: MIT + file LICENSE Encoding: UTF-8 LazyData: true RoxygenNote: 7.3.3 Biarch: true Depends: R (≥ 3.4.0) Imports: dplyr, generics, ggplot2, glue, lifecycle, magrittr, methods, Rcpp (≥ 0.12.0), RcppParallel (≥ 5.0.1), rlang, rstan (≥ 2.26.0), rstantools (≥ 2.5.0), scales, tidybayes, tidyr LinkingTo: BH (≥ 1.66.0), Rcpp (≥ 0.12.0), RcppEigen (≥ 0.3.3.3.0), RcppParallel (≥ 5.0.1), rstan (≥ 2.26.0), StanHeaders (≥ 2.26.0) SystemRequirements: GNU make Suggests: bayesplot, covr, knitr, latex2exp, posterior, progress, rmarkdown, stringr, testthat (≥ 3.0.0) Config/testthat/edition: 3 URL: https://sempwn.github.io/bennu/ BugReports: https://github.com/sempwn/bennu/issues VignetteBuilder: knitr NeedsCompilation: yes Packaged: 2025-10-09 17:28:23 UTC; rstudio Author: Mike Irvine [aut, cre, cph], Samantha Bardwell [ctb], Andrew Johnson [ctb] Maintainer: Mike Irvine <mike.irvine@bccdc.ca> Repository: CRAN Date/Publication: 2025-10-09 17:50:02 UTC The 'bennu' package. Description Bayesian Estimation of Naloxone use Number Under-reporting Author(s) Maintainer : Mike Irvine mike.irvine@bccdc.ca ( ORCID ) [copyright holder] Other contributors: Samantha Bardwell [contributor] Andrew Johnson [contributor] References Stan Development Team (2020). RStan: the R interface to Stan. R package version 2.21.2. https://mc-stan.org See Also Useful links: https://sempwn.github.io/bennu/ Report bugs at https://github.com/sempwn/bennu/issues Pipe operator Description See magrittr:: %>% for details. Usage lhs %>% rhs Arguments lhs A value or the magrittr placeholder. rhs A function call using the magrittr semantics. Value The result of calling rhs(lhs) . Run Bayesian estimation of naloxone number under-reporting Description Samples from Bayesian model using input from data frame Usage est_naloxone( d, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... ) Arguments d data frame with format regions unique id for region times time in months Orders Kits ordered Reported_Used Kits reported as used Reported_Distributed Kits reported as distributed region_name Optional label for region psi_vec reporting delay distribution max_delays maximum delay from kit ordered to kit distributed delay_alpha shape parameter for order to distributed delay distribution delay_beta shape parameter for order to distributed delay distribution priors list of prior values including their mean (mu) and standard deviation (sigma) run_estimation if TRUE will sample from posterior otherwise will sample from prior only rw_type 1 - random walk of order one. 2 - random walk of order 2. chains A positive integer specifying the number of Markov chains. The default is 4. iter A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000. seed Seed for random number generation adapt_delta (double, between 0 and 1, defaults to 0.8) pars A vector of character strings specifying parameters of interest. The default is NA indicating all parameters in the model. If include = TRUE , only samples for parameters named in pars are stored in the fitted results. Conversely, if include = FALSE , samples for all parameters except those named in pars are stored in the fitted results. include Logical scalar defaulting to TRUE indicating whether to include or exclude the parameters given by the pars argument. If FALSE , only entire multidimensional parameters can be excluded, rather than particular elements of them. ... other parameters to pass to rstan::sampling Value An S4 rstan::stanfit class object containing the fitted model See Also Other inference: est_naloxone_vec () Examples ## Not run: library(rstan) library(bayesplot) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores(logical = FALSE)) d <- generate_model_data() priors <- list( c = list(mu = 0, sigma = 1), ct0 = list(mu = 0, sigma = 1), zeta = list(mu = 0, sigma = 1), mu0 = list(mu = 0, sigma = 1), sigma = list(mu = 0, sigma = 1) ) fit <- est_naloxone(d, priors = priors, iter = 100, chains = 1) mcmc_pairs(fit, pars = c("sigma", "mu0"), off_diag_args = list(size = 1, alpha = 0.5) ) ## End(Not run) Run Bayesian estimation of naloxone number under-reporting Description Samples from Bayesian model Usage est_naloxone_vec( N_region, N_t, N_distributed, regions, times, Orders2D, Reported_Distributed, Reported_Used, region_name, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... ) Arguments N_region Number of regions N_t number of time steps N_distributed Number of samples of reporting for distribution of kits regions vector (time, region) of regions (coded 1 to N_region) times vector (time, region) of regions (coded 1 to N_t) Orders2D vector (time, region) of orders Reported_Distributed vector (time, region) reported as distributed Reported_Used vector (time, region) reported as used region_name bring in region names psi_vec reporting delay distribution max_delays maximum delay from kit ordered to kit distributed delay_alpha shape parameter for order to distributed delay distribution delay_beta shape parameter for order to distributed delay distribution priors list of prior values including their mean (mu) and standard deviation (sigma) run_estimation if TRUE will sample from posterior otherwise will sample from prior only rw_type 1 - random walk of order one. 2 - random walk of order 2. chains A positive integer specifying the number of Markov chains. The default is 4. iter A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000. seed Seed for random number generation adapt_delta (double, between 0 and 1, defaults to 0.8) pars A vector of character strings specifying parameters of interest. The default is NA indicating all parameters in the model. If include = TRUE , only samples for parameters named in pars are stored in the fitted results. Conversely, if include = FALSE , samples for all parameters except those named in pars are stored in the fitted results. include Logical scalar defaulting to TRUE indicating whether to include or exclude the parameters given by the pars argument. If FALSE , only entire multidimensional parameters can be excluded, rather than particular elements of them. ... other parameters to pass to rstan::sampling Value An S4 rstan::stanfit class object containing the fitted model See Also Other inference: est_naloxone () Experimental validation results Description Generated data from validation experiments of simulated data Usage experimental_validation_data Format experimental_validation_data A data frame with 200 rows and 8 columns: .variable Model variable p50 Median of the posterior p25, p75 2nd and 3rd quartiles of the posterior p05, p95 1st and 19th ventiles of the posterior true_value The vaSee magrittr::[magrittr:pipe]%>% for details.
lhs %>% rhsBayesian Estimation of Naloxone use Number Under-reporting
Samples from Bayesian model using input from data frame
est_naloxone( d, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... )library(rstan) library(bayesplot) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores(logical = FALSE)) d <- generate_model_data() priors <- list( c = list(mu = 0, sigma = 1), ct0 = list(mu = 0, sigma = 1), zeta = list(mu = 0, sigma = 1), mu0 = list(mu = 0, sigma = 1), sigma = list(mu = 0, sigma = 1) ) fit <- est_naloxone(d, priors = priors, iter = 100, chains = 1) mcmc_pairs(fit, pars = c("sigma", "mu0"), off_diag_args = list(size = 1, alpha = 0.5) )Samples from Bayesian model
est_naloxone_vec( N_region, N_t, N_distributed, regions, times, Orders2D, Reported_Distributed, Reported_Used, region_name, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... )Generated data from validation experiments of simulated data
experimental_validation_datahtmlhttps://lifecycle.r-lib.org/articles/stages.html#deprecatedlifecycle-deprecated.svgoptions: alt='[Deprecated]'[Deprecated] Simulate kits ordered and kits distributed for a set number of regions and time-points. The kits ordered simulation is a simple square-term multiplied by region_coeffs. For example if region_coeffs = c(1,2) then the number of kits ordered at month 12 are c(1,2) * 12^2 = c(144,288). The probability of kit use in time is assumed to increase linearly in inverse logit space at a constant rate 0.1. The probability of reporting for each month and region is iid distributed logit^-1(p) N(2,5) which produces a mean reporting rate of approximately 88%
generate_model_data( N_t = 24, region_coeffs = c(5, 0.5), c_region = c(-1, 2), reporting_freq = NULL )Provides a summary of: Estimated kits distributed Percentage of kits distributed that are reported Estimated kits used percentage of kits used that are reported percentage of kits orders that are used probability kit used if distributed
kit_summary_table( fit, ..., data = NULL, accuracy = 0.01, cri_range = 0.95, ndraws = NULL )fit <- est_naloxone(d) kit_summary_table(fit,regions,data = d)Generated data from validation experiments of simulated data
missing_data_validationModel generating process using random walk to match data generating model in Bayesian framework
model_random_walk_data( N_t = 24, region_coeffs = c(5, 0.5), c_region = c(-1, 2), sigma = 2, zeta = 0.5, mu0 = -1, Orders = NULL, reporting_freq = NULL )plot can compare between two different model fits or a single model fit by region. If data are simulated then can also include in plot. For more details see the introduction vignette: vignette("Introduction", package = "bennu")
plot_kit_use(..., data = NULL, reported = FALSE, regions_to_plot = NULL)| Repository | Version | Published | First seen | Last seen | Docs |
|---|---|---|---|---|---|
| CRAN | 0.3.2 | 2026-05-29 | 2026-05-30 |
표시할 OSV 데이터가 없습니다.
표시할 OpenAlex 데이터가 없습니다.