zic {zic} | R Documentation |
zic
fits zero-inflated count models via Markov chain Monte Carlo methods.
zic(formula, data, a0, b0, c0, d0, e0, f0, n.burnin, n.mcmc, n.thin, tune = 1.0, scale = TRUE)
formula |
A symbolic description of the model to be fit specifying the response variable and covariates. |
data |
A data frame in which to interpret the variables in |
a0 |
The prior variance of alpha. |
b0 |
The prior variance of beta_j. |
c0 |
The prior variance of gamma. |
d0 |
The prior variance of delta_j. |
e0 |
The shape parameter for the inverse gamma prior on sigma^2. |
f0 |
The inverse scale parameter the inverse gamma prior on sigma^2. |
n.burnin |
Number of burn-in iterations of the sampler. |
n.mcmc |
Number of iterations of the sampler. |
n.thin |
Thinning interval. |
tune |
Tuning parameter of Metropolis-Hastings step. |
scale |
If true, all covariates (except binary variables) are rescaled by dividing by their respective standard errors. |
The considered zero-inflated count model is given by
y*_i ~ Poisson[exp(eta*_i)],
eta*_i = x_i' * beta + epsilon_i, epsilon_i ~ N( 0, sigma^2 ),
d*_i = x_i' * delta + nu_i, nu_i ~ N(0,1),
y_i = 1(d*_i>0) y*_i,
where y_i and x_i are observed. The assumed prior distributions are
alpha ~ N(0,a0),
beta_k ~ N(0,b0), k=1,...,K,
gamma ~ N(0,c0)
delta_k ~ N(0,d0), k=1,...,K,
sigma^2 ~ Inv-Gamma(e0,f0).
The sampling algorithm described in Jochmann (2013) is used.
A list containing the following elements:
alpha |
Posterior draws of alpha (coda mcmc object). |
beta |
Posterior draws of beta (coda mcmc object) . |
gamma |
Posterior draws of gamma (coda mcmc object). |
delta |
Posterior draws of delta (coda mcmc object). |
sigma2 |
Posterior draws of sigma^2 (coda mcmc object). |
acc |
Acceptance rate of the Metropolis-Hastings step. |
Jochmann, M. (2013). “What Belongs Where? Variable Selection for Zero-Inflated Count Models with an Application to the Demand for Health Care”, Computational Statistics, 28, 1947–1964.
## Not run: data( docvisits ) mdl <- docvisits ~ age + agesq + health + handicap + hdegree + married + schooling + hhincome + children + self + civil + bluec + employed + public + addon post <- zic( f, docvisits, 10.0, 10.0, 10.0, 10.0, 1.0, 1.0, 1000, 10000, 10, 1.0, TRUE ) ## End(Not run)