Description Usage Arguments Value Note Author(s) References See Also Examples
Employs a Dirichlet Process (DP) prior on the set of by-subject random effect parameters
under repeated waves of measurements to allow the number of random effect parameters specified per subject, q
,
to be equal to the number of measurement waves, T
. Random effects are grouped by subject and
all q
parameters receive the DP prior. An additional set of random effects are included that
utilize a different grouping factor; e.g. treatment(s) exposure or dosage. These additional random
effects are mapped back to subjects through a multiple membership weight matrix.
1 2 3 |
y |
A univariate continuous response, specified as an N x 1 matrix or vector, where |
subject |
The objects on which repeated measures are conducted that serves as the random effects
grouping factor. Input as an N x 1 matrix or vector of subject-measure cases in either
integer or character format; e.g. |
trt |
An integer or character matrix/vector of length |
time |
A univariate vector of length |
n.random |
The desired number of time-indexed subject random effect terms, |
n.fix_degree |
The desired polynomial order in time to use for generating time-based fix effects.
The fixed effects matrix will be constructed as,
|
formula |
Nuisance fixed and random effects may be entered in |
random.only |
A Boolean variable indicating whether the input formula contains random (for fixed) effects in the case that only
one set are entered. If excluded and |
data |
a |
Omega |
An S x S numerical matrix object to encode the CAR adjacency matrix for random effects mapped through multiple membership,
where |
group |
A numeric or character vector of length |
subj.aff |
A n.aff x 1 vector subset of |
W.subj.aff |
An n.aff x S numeric matrix that maps a set of random effects to affected subjects, where |
multi |
A boolean scalar input that when set to |
n.iter |
Total number of MCMC iterations. |
n.burn |
Number of MCMC iterations to discard. |
n.thin |
Gap between successive sampling iterations to save. |
strength.mm |
Sets both the shape and rate parameter for a |
shape.dp |
Shape parameter under a c ~ G(shape.dp, 1) prior on the concentration parameter of the DP (prior
on the set of random effects parameters, b_1, ..., b_n ~ DP(c,G_0)
where |
rate.dp |
Rate parameter under a c ~ G(shape.dp, rate.dp) prior on the concentration parameter of the DP. |
plot.out |
A boolean variable indicating whether user wants to return plots with output results. Defaults to |
option |
Modeling option, of which there are three: 1. |
S3 dpgrowmm
object, for which many methods are available to return and view results. Generic functions applied
to an object, res
of class dpgrow
, includes:
summary(res) |
returns |
print(summary(res)) |
prints contents of summary to console. |
plot(res) |
returns results plots, including the set of subject random effects values and credible intervals, a sample of by-subject growth curves, mean growth curves split by each treatment and control, as well as selected trace plots for number of clusters and for precision parameters for the likehilood and random effects. Lastly, a trace plot for the deviance statistic is also included. |
samples(res) |
contains ( |
resid(res) |
contains the model residuals. |
The intended focus for this package are data where both number of subjects and number of repeated measures are limited. A DP prior
is placed on the by-subject random effects to borrow strength across subjects for each estimation of each subject's growth curve. The
imposition of the DP prior also allows the resulting posterior distributions over the subject random effects to be non-Gaussian.
The dpgrow
function is very similar to dpgrowmm
; only the latter includes a separate set of random effects not grouped
by subject (e.g. for treatment dosages allocated to subjects) mapped back to subject-time cases through a multiple membership design matrix.
The dpgrowmult
function generalizes dpgrowmm
by allowing more than one multiple membership effects term.
See Savitsky and Paddock (2011) for detailed model constructions.
Terrance Savitsky tds151@gmail.com Susan Paddock paddock@rand.org
S. M. Paddock and T. D. Savitsky (2012) Bayesian Hierarchical Semiparametric Modeling of Longitudinal Post-treatment Outcomes from Open-enrollment Therapy Groups, submitted to: JRSS Series A (Statistics in Society).
T. D. Savitsky and S. M. Paddock (2012) Visual Sufficient Statistics for Repeated Measures data with growcurves for R, submitted to: Journal of Statistical Software.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
## extract simulated dataset
library(growcurves)
data(datsim)
## attach(datsim)
## Model with DP on clients effects, but now INCLUDE session random effects
## in a multiple membership construction communicated with the N x S matrix, W.subj.aff.
## Returns object, res.mm, of class "dpgrowmm".
shape.dp = 3
strength.mm = 0.001
res.mm = dpgrowmm(y = datsim$y, subject = datsim$subject,
trt = datsim$trt, time = datsim$time,
n.random = datsim$n.random,
n.fix_degree = 2, Omega = datsim$Omega,
group = datsim$group,
subj.aff = datsim$subj.aff,
W.subj.aff = datsim$W.subj.aff,
n.iter = 10000, n.burn = 2000, n.thin = 10,
shape.dp = shape.dp, rate.dp = rate.dp,
strength.mm = strength.mm, option = "mmcar")
plot.results = plot(res.mm) ## ggplot2 plot objects,
summary.results = summary(res.mm) ## credible intervals and fit statistics
samples.posterior = samples(res.mm) ## posterior sampled values
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.