STANThe bvarnet package allows user to estimate Bayesian
multilevel Vector Auto Regressive (VAR) models for binary, ordinal and
continuous outcome variables. Missing data is handled through listwise
deletion and a skip-lag mechanism, which skips the estimation of the
temporal structure when there is a gap between two timepoints. Further,
we provide functionality to conduct hypothesis tests.
To install bvarnet from CRAN, you need to have CmdStanR installed
which is not available on CRAN. To do this, make sure you have RTools
(Windows) or Xcode
(Mac) installed and the run the following code
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2)If you run into any problems, you can look at the Getting started with CmdStanR guide.
After setting up cmdstanr you can install the newest version of the package from CRAN:
install.packages("bvarnet", type = "source")Or you can install the development version of bvarnet
from GitHub with:
if(!requireNamespace("remotes")) {
install.packages("remotes")
}
remotes::install_github("flo1met/bvarnet")The best place to start learning how to use this package to estimate Bayesian (multilevel) Vector Autoregression is the Getting Started Vignette. This vignette covers the basic model syntax, how to specify priors and how to extract the relevant parameters.
bvarnet is actively being developed. While the core
functionality is stable, we have several features planned for future
releases. For bug reports or feature request, please visit our Issue Tracker.