Learn R Programming

growcurves (version 0.2.4.1)

ddpPost: Run a Bayesian mixed effects model for by-subject random effects with DDP prior

Description

An internal function to ddpgrow

Usage

ddpPost(y, X, Z, subject, dosemat, numt, typet, Omega, omegaplus, n.iter, n.burn, n.thin, shapealph, ratebeta, M.init)

Arguments

y
An N x 1 response (of subject-measure cases)
X
Fixed effects design matrix
Z
Random effects design matrix. Assumed grouped by subjects
subject
An N x 1 set of subject identifiers
dosemat
An P x T Anova or Multiple Membership design matrix linking treatment dosages to subjects where T is the total number dosages across all treatments + 1 for an intercept. This formulation assumes there is a hold-out dose for each treatment. e.g. the null dosage.
numt
A numeric vector of length equal to the number of treatments that contains the number of dosages for each treatment.
typet
A numeric vector of length equal to the number of treatments that contains the base distribution for each treatment. 1 = "car", 2 = "mvn", 3 = "ind"
Omega
A list object of length equal to the number of treatments with "car" selected for base distribution. Each entry is an numt[m] x numt[m] numeric CAR adjacency matrix for the dosages of treatment m.
omegaplus
A list object of length equal to the number of treatments under "car" containing numeric vectors that are rowSums of the corresponding matrix element in Omega.
n.iter
The number of MCMC iterations
n.burn
The number of MCMC burn-in iterations to discard
n.thin
The step increment of MCMC samples to return
shapealph
The shape parameter for the $\Gamma$ prior on the DP concentration parameter.
ratebeta
The rate parameter for the $\Gamma$ prior on the DP concentration parameter.
M.init
Initial MCMC chain scalar value for number of by-subject clusters. If excluded defaults to length(unique(subject)).

Value

res A list object containing MCMC runs for all model parameters.

See Also

dpgrow