DPmeta: Bayesian analysis for a semiparametric linear mixed effects...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function generates a posterior density sample for a semiparametric linear mixed effects meta-analysis model using a Dirichlet process or a Mixture of Dirichlet process prior for the distribution of the random effects.

Usage

1
2

Arguments

formula

a two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. Both effect and variance must be included in the LHS of the formula object

prior

a list giving the prior information. The list include the following parameter: a0 and b0 giving the hyperparameters for prior distribution of the precision parameter of the Dirichlet process prior, alpha giving the value of the precision parameter (it must be specified if a0 and b0 are missing, see details below), tau1 and tau2 giving the hyperparameters for the prior distribution of the variance of the centering distribution, sigma2 giving the value of the variance of the centering distribution (it must be specified if tau1 and tau2 are missing), mub and Sb giving the hyperparameters of the normal prior distribution for the mean of the normal baseline distribution, mu giving the value of the mean of the centering distribution (it must be specified if mub and Sb are missing), and beta0 and Sbeta0 giving the hyperparameters of the normal prior distribution for the fixed effects (must be specified only if fixed effects are considered in the model).

mcmc

a list giving the MCMC parameters. The list must include the following integers: nburn giving the number of burn-in scans, nskip giving the thinning interval, nsave giving the total number of scans to be saved, and ndisplay giving the number of saved scans to be displayed on screen (the function reports on the screen when every ndisplay iterations have been carried out).

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 (TRUE) or the continuation of a previous analysis (FALSE). In the latter case the current value of the parameters must be specified in the object state.

data

data frame.

na.action

a function that indicates what should happen when the data contain NAs. The default action (na.fail) causes DPmeta to print an error message and terminate if there are any incomplete observations.

Details

This generic function fits a semiparametric linear mixed effects meta-analysis model:

yi ~ N(thetai+ Xi beta, sigma2ei), i=1,…,n

thetai | G ~ G

G | alpha, G0 ~ DP(alpha G0)

where, G0=N(theta| mu, sigma2). To complete the model specification, independent hyperpriors are assumed,

alpha | a0, b0 ~ Gamma(a0,b0)

beta | beta0, Sbeta0 ~ N(beta0,Sbeta0)

mu | mub, Sb ~ N(mub,Sb)

sigma^-2 | tau1, tau2 ~ Gamma(tau1/2,tau2/2)

The precision or total mass parameter, α, of the DP prior can be considered as random, having a gamma distribution, Gamma(a0,b0), or fixed at some particular value. When alpha is random the method described by Escobar and West (1995) is used. To let alpha to be fixed at a particular value, set a0 to NULL in the prior specification.

The computational implementation of the model is based on the marginalization of the DP and on the use of MCMC methods for conjugate priors (Escobar, 1994; Escobar and West, 1998).

The average effect is sampled using the epsilon-DP approximation proposed by Muliere and Tardella (1998), with epsilon=0.01.

Value

An object of class DPmeta representing the linear mixed-effects model fit. Generic functions such as print, plot, summary, and anova have methods to show the results of the fit. The results include beta, mu, sigma2, alpha, and the number of clusters.

The function DPrandom can be used to extract the posterior mean of the random effects.

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

b

a vector of dimension (nsubjects) giving the value of the random effects for each subject.

bclus

a vector of dimension (nsubjects) giving the value of the random effects for each clusters (only the first ncluster are considered to start the chain).

ss

an interger vector defining to which of the ncluster clusters each subject belongs.

beta

giving the value of the fixed effects.

mu

giving the mean of the normal baseline distributions.

sigma2

giving the variance of the normal baseline distributions.

Author(s)

Alejandro Jara <atjara@uc.cl>

References

Escobar, M.D. (1994) Estimating Normal Means with a Dirichlet Process Prior, Journal of the American Statistical Association, 89: 268-277.

Escobar, M.D. and West, M. (1995) Bayesian Density Estimation and Inference Using Mixtures. Journal of the American Statistical Association, 90: 577-588.

Escobar, M.D. and West, M. (1998) Computing Bayesian Nonparametric Hierarchical Models, in Practical Nonparametric and Semiparametric Bayesian Statistics, eds: D. Dey, P. Muller, D. Sinha, New York: Springer-Verlag, pp. 1-22.

Muliere, P. and Tardella, L. (1998) Approximating distributions of random functionals of Ferguson-Dirichlet priors. The Canadian Journal of Statistics, 26(2): 283-297.

See Also

DPrandom, DPMmeta, DPlmm , DPglmm , DPolmm , DPMlmm , DPMglmm, DPMolmm

Examples

 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
## Not run: 

    ##################################################################    
    # Data on the effectiveness of silver sulfadiazine coating
    # on venous catheters for preventing bacterial colonisation of 
    # the catheter and bloodstream infection. 
    # Veenstra D et al (1998) "Efficacy of Antiseptic Impregnated 
    # Central Venous Catheters in Preventing Nosocomial Infections: 
    # A Meta-analysis" JAMA 281:261-267. 
    #
    # Note that -Inf and Inf have been replaced by NA.
    ##################################################################    
    
      studies <- c("Tennenberg","Maki","vanHeerden",
                    "Hannan","Bach(a)","Bach(b)",
                    "Heard","Collins","Ciresi","Ramsay",
                    "Trazzera","George")    

      logOR <- c(-1.5187189,-0.7136877,-1.3217558,-0.1910552,
                  NA,-2.2005195,-0.5057461,-2.3538784,-0.3643810,
                  -0.5371429,-0.7608058,-2.1400662)
       
      varlogOR <- c(0.4157541,0.2632550,0.6739189,0.3727788,NA,
                    0.7623470,0.2306169,0.7477891,0.3645463,0.2291839,
                    0.3561542,0.5190489)^2

      names(logOR) <- studies
      names(varlogOR) <- studies
      y <- cbind(logOR,varlogOR)
      colnames(y) <- c("logOR","varlogOR")

    # Prior information

      prior<-list(alpha=1,
                  tau1=20,
                  tau2=10,
                  mub=0,
                  Sb=100)

    # Initial state
      state <- NULL


    # MCMC parameters

      nburn<-20000
      nsave<-10000
      nskip<-20
      ndisplay<-100
      mcmc <- list(nburn=nburn,
                   nsave=nsave,
                   nskip=nskip,
                   ndisplay=ndisplay)

    # Fit the model: First run
    
      fit1<-DPmeta(formula=y~1,prior=prior,mcmc=mcmc,
                   state=state,status=TRUE)
      fit1

    # Summary with HPD and Credibility intervals
      summary(fit1)
      summary(fit1,hpd=FALSE)

    # Plot model parameters (to see the plots gradually set ask=TRUE)
      plot(fit1,ask=FALSE)
      plot(fit1,ask=FALSE,nfigr=2,nfigc=2)	


## End(Not run)

DPpackage documentation built on May 1, 2019, 10:23 p.m.

Related to DPmeta in DPpackage...