Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates a posterior density sample for a semiparametric random effects multivariate meta-analysis model using a Dirichlet process or a Mixture of Dirichlet process prior for the distribution of the random effects. Support provided by the NIH/NCI R01CA75981 grant.
1 2 | DPmultmeta(y,asymvar,prior,mcmc,state,status,
data=sys.frame(sys.parent()))
|
y |
a vector or matrix giving the data or effects from which the density estimate is to be computed. |
asymvar |
a vactor or matrix giving the asymptotic covariance matrix for each effect. The dimension of this matrix is the number of records/studies times the the half-stored elements of the study-specific covariance matrix. |
prior |
a list giving the prior information. The list includes the following
parameter: |
mcmc |
a list giving the MCMC parameters. The list must include
the following integers: |
state |
a list giving the current value of the parameters. This list is used if the current analysis is the continuation of a previous analysis. |
status |
a logical variable indicating whether this run is new ( |
data |
data frame. |
This generic function fits a semiparametric random effects multivariate meta-analysis model:
yi ~ N(thetai, Sigmai), i=1,…,n
thetai | G ~ G
G | alpha, G0 ~ DP(alpha G0)
where, G0=N(theta| m1, s1). To complete the model specification, independent hyperpriors are assumed,
alpha | a0, b0 ~ Gamma(a0,b0)
m1 | m2, s2 ~ N(m2,s2)
s1 | nu, psi ~ IW(nu,psi)
Note that the inverted-Wishart prior is parametrized such that if A ~ IWq(nu, psi) then E(A)= psiinv/(nu-q-1).
To let part of the baseline distribution fixed at a particular value, set the corresponding hyperparameters of the prior distributions to NULL in the hyperprior specification of the model.
The computational implementation of the model is based on the marginalization of
the DP
and on the use of MCMC methods for conjugate priors
for a collapsed state of MacEachern (1998).
An object of class DPmultmeta
representing the random
effects model fit. Generic functions such as print
, plot
,
and summary
, have methods to show the results of the fit.
The results include m1
, s1
, alpha
, and the
number of clusters.
The list state
in the output object contains the current value of the parameters
necessary to restart the analysis. If you want to specify different starting values
to run multiple chains set status=TRUE
and create the list state based on
this starting values. In this case the list state
must include the following objects:
ncluster |
an integer giving the number of clusters. |
alpha |
giving the value of the precision parameter |
muclus |
a matrix of dimension (nobservations+1)*(nvariables) giving the means of the clusters
(only the first |
ss |
an interger vector defining to which of the |
m1 |
giving the mean of the normal baseline distributions. |
s1 |
giving the covariance matrix of the normal baseline distributions. |
Alejandro Jara <atjara@uc.cl>
Peter Mueller <pmueller@mdanderson.org>
MacEachern, S.N. (1998) Computational Methods for Mixture of Dirichlet Process Models, in Practical Nonparametric and Semiparametric Bayesian Statistics, eds: D. Dey, P. Muller, D. Sinha, New York: Springer-Verlag, pp. 23-44.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | ## Not run:
######################################################################
# Simulated Data:
# mu_i ~ 0.5 N(mub1,Sigmab1) + 0.5 N(mub2,Sigmab2)
# y_i ~ N(mu_i,Sigma_i)
# Sigma_1=...=Sigma_n=Sigma assumed to be known
######################################################################
nvar <- 2
nrec <- 100
Sigma <- matrix(c(0.25,0.15,0.15,0.25),nrow=nvar,ncol=nvar)
mub1 <- rep(-1.5,nvar)
mub2 <- rep( 0.5,nvar)
Sigmab1 <- matrix(c(0.25,-0.175,-0.175,0.25),nrow=nvar,ncol=nvar)
Sigmab2 <- matrix(c(0.25, 0.0875, 0.0875,0.25),nrow=nvar,ncol=nvar)
ind <- rbinom(nrec,1,0.5)
z1 <- mub1+matrix(rnorm(nvar*nrec),nrow=nrec,ncol=nvar)
z2 <- mub2+matrix(rnorm(nvar*nrec),nrow=nrec,ncol=nvar)
mu <- ind*z1+(1-ind)*z2
y <- NULL
for(i in 1:nrec)
{
z <- mu[i,]+matrix(rnorm(nvar),nrow=1,ncol=nvar)
y <- rbind(y,z)
}
colnames(y) <- c("y1","y2")
######################################################################
# Asymptotic variance
######################################################################
z <- NULL
for(i in 1:nvar)
{
for(j in i:nvar)
{
z <- c(z,Sigma[i,j])
}
}
asymvar <- matrix(z,nrow=nrec,ncol=nvar*(nvar+1)/2,byrow=TRUE)
# Prior information
s2 <-diag(100,nvar)
m2 <-rep(0,nvar)
nu <- 4
psiinv <- diag(1,nvar)
prior<-list(a0=1,
b0=1/5,
nu=nu,
m2=m2,
s2=s2,
psiinv=psiinv)
# Initial state
state <- NULL
# MCMC parameters
nburn <- 500
nsave <- 1000
nskip <- 0
ndisplay <- 100
mcmc <- list(nburn=nburn,
nsave=nsave,
nskip=nskip,
ndisplay=ndisplay)
# Fitting the model
fit1 <- DPmultmeta(y=y,asymvar=asymvar,prior=prior,
mcmc=mcmc,state=state,status=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.