Learn R Programming

rstap

Spatial-Temporal Aggregated Predictor Models Implemented in R

This is an R package that fits spatial temporal aggregated predictor models
using Stan (via the rstan package) for the back-end estimation. The primary target audience is researchers interested in the effect of built environment features (BEFs) on human health, though other applications are possible. See the package's website for an introduction.

Installation

Development Version

To install the current development version from GitHub, first make sure that you can install the rstan package and C++ toolchain by following these instructions.

Once rstan is successfully installed, you can install rstap from GitHub using the devtools package by executing the following in R:

if (!require(devtools)) {
  install.packages("devtools")
  library(devtools)
}
install_github("biostatistics4socialimpact/rstap")

Note that vignettes for this package are separately available from the rstap website.

If installation fails, please let us know by filing an issue.

Copy Link

Version

Install

install.packages('rstap')

Monthly Downloads

7

Version

1.0.3

License

GPL (>= 3)

Maintainer

Adam Peterson

Last Published

February 6th, 2019

Functions in rstap (1.0.3)

as.matrix.stapreg

Extract the posterior sample via matrix
predictive_error

In-sample or out-of-sample predictive errors
rstap-package

The 'rstap' package.
summary.stapreg

Summary method for stapreg objects
predictive_interval.stapreg

Predictive intervals
terms.stapreg

terms method for stapreg objects
se

Extract standard errors
check_constant_vars

Check if any variables in a model frame are constants (the exception is that a constant variable of all 1's is allowed)
example_model

Example model
validate_distancedata

Validate distance_data
get_stapless_formula

get_stapless_formula
validate_family

Check family argument
pairs.stapreg

Pairs method for stapreg objects
get_y

Extract X, Y or Z from a stapreg object
family.stapreg

family method for stapreg objects
formula.stapreg

formula method for stapreg objects
plot.stapreg

Plot method for stapreg objects
validate_weights

Check weights argument
stap_glm.fit

Fitting Generalized Linear STAP models
waic.stapreg

WAIC
posterior_interval.stapreg

Posterior uncertainty intervals
print.stapreg

Print method for stapreg objects
stap_termination

Spatial-Temporal Exposure Termination-Maximization Estimates
stap_glmer

Bayesian spatial-temporal generalized linear models with group-specific terms via Stan
posterior_predict.stapreg

Draw from posterior predictive distribution
prior_summary.stapreg

Summarize the priors used for an rstap model
stapreg-methods

Methods for stapreg objects
priors

Prior distributions and options
validate_newdata

Validate newsubjdata argument for posterior_predict, log_lik, etc.
log_lik.stapreg

Pointwise log-likelihood matrix
model.frame.stapreg

model.frame method for stapreg objects
model.matrix.stapreg

model.matrix method for stapreg objects
validate_timedata

Validate time_data
nsap

Retrieves number of temporal aggregated predictors
rstap-datasets

Datasets for rstap examples
stap_data

Create a stap_data object
stap_glm

Bayesian generalized spatial-temporal aggregated predictor(STAP) models via Stan
stapreg-objects

Fitted model objects
stapreg

Create a stapreg object
adapt_delta

Target average acceptance probability
nstap

Retrieves number of Spatial-temporal aggregated predictors
ntap

Retrieves number of temporal aggregated predictors