svyLocAdj is an R package for adjusting and analyzing Demographic and Health Survey (DHS) data using Bayesian modeling approaches implemented through Stan.
Before installing svyLocAdj, users must ensure that:
rstan package is successfully installed and configured.Since svyLocAdj uses Stan for Bayesian computation, proper compiler and rstan installation are required.
Install Rtools corresponding to your version of R:
https://cran.r-project.org/bin/windows/Rtools/
After installation, verify that the compiler is available:
install.packages("pkgbuild")
pkgbuild::has_build_tools(debug = TRUE)
A return value of TRUE indicates that the build tools are correctly configured.
Install Apple's Command Line Tools:
xcode-select --install
For Ubuntu/Debian systems:
sudo apt update
sudo apt install build-essential
For other Linux distributions, install the equivalent GNU compiler tools.
Install rstan and its dependencies:
install.packages(c("StanHeaders", "rstan"), dependencies = TRUE)
Load rstan and verify that it is working correctly:
library(rstan)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
For detailed installation instructions and platform-specific guidance, see:
https://mc-stan.org/users/interfaces/rstan
If devtools is not already installed:
install.packages("devtools")
Install the latest development version from GitHub:
# devtools::install_github("ksbakar/svyLocAdj")
install.packages("svyLocAdj", repos = c('https://ksbakar.r-universe.dev', 'https://cloud.r-project.org'))
Replace USERNAME with the GitHub username or organization hosting the repository.
library(svyLocAdj)
Confirm the installation:
packageVersion("svyLocAdj")
If Stan models fail to compile:
rstan and StanHeaders:install.packages(c("StanHeaders", "rstan"))
pkgbuild::has_build_tools(debug = TRUE)
Ensure that:
library(svyLocAdj)
# Example workflow
# ... will add package-specific examples here soon ...
If you encounter bugs or installation problems, please open an issue in the GitHub repository.
See the LICENSE file for licensing information.