Fitting Generalized Linear STAP Difference in Difference models

stapdnd_glm.fit(y, z, w, dists_crs, u_s, times_crs, u_t, subject_matrix,
  subject_n, weight_functions, stap_data, max_distance = max(dists_crs),
  max_time = max(times_crs), weights = rep(1, NROW(y)),
  offset = rep(0, NROW(y)), family = stats::gaussian(), ...,
  prior = normal(), prior_intercept = normal(),
  prior_stap = normal(), group = list(), prior_theta = list(theta_one
  = normal()), prior_aux = cauchy(location = 0L, scale = 5L),
  adapt_delta = NULL)

Arguments

y

n length vector or n x 2 matrix of outcomes

z

n x p design matrix of subject specific covariates

w

n x k design matrix of random effects

dists_crs

(q_s+q_st) x M matrix of distances between outcome observations and built environment features with a hypothesized spatial scale

u_s

n x (q *2) matrix of compressed row storage array indices for dists_crs

times_crs

(q_t+q_st) x M matrix of times where the outcome observations were exposed to the built environment features with a hypothesized temporal scale

u_t

n x (q*2) matrix of compressed row storage array indices for times_crs

subject_matrix

n X N matrix that contains column indices denoting subject specific observations

subject_n

n x 1 length vector that contains the number of observations for each subject

weight_functions

a Q x 2 matrix with integers coding the appropriate weight function for each STAP

stap_data

object of class "stap_data" that contains information on all the spatial-temporal predictors in the model

max_distance

the upper bound on any and all distances included in the model

max_time

the upper bound on any and all times included in the model

weights

weights to be added to the likelihood observation for a given subject

offset

offset term to be added to the outcome for a given subject

family

distributional family - only binomial gaussian or poisson currently allowed

...

optional arguments passed to the sampler - e.g. iter,warmup, etc.

prior, prior_intercept, prior_stap, prior_theta, prior_aux

see stap_glm for more information

group

list of of group terms from lme4::glmod

adapt_delta

See the adapt_delta help page for details.