DPMmeta              package:DPpackage              R Documentation

_B_a_y_e_s_i_a_n _a_n_a_l_y_s_i_s _f_o_r _a _s_e_m_i_p_a_r_a_m_e_t_r_i_c _l_i_n_e_a_r _m_i_x_e_d _e_f_f_e_c_t_s _m_e_t_a-_a_n_a_l_y_s_i_s _m_o_d_e_l _u_s_i_n_g _a _D_P_M _o_f _n_o_r_m_a_l_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     DPMmeta(formula,prior,mcmc,state,status,data=sys.frame(sys.parent()),
             na.action=na.fail)

_A_r_g_u_m_e_n_t_s:

 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), 'tau01' and 'tau02' giving
          the hyperparameters of the  inverted gamma prior distribution
          for the variance of the normal kernel, 'mb' and 'Sb' giving
          the hyperparameters  of the normal prior distribution for the
          mean of the normal baseline distribution, 'mub' giving the
          value of the mean of the centering distribution (it must be
          specified if  'mb' and 'Sb' are missing), 'tau11' and 'tau12'
          giving the hyperparameters of the  inverted gamma prior
          distribution for the variance of the normal baseline
          distribution, 'sigmab' giving the value of the variance of
          the centering distribution (it must be specified if  'tau11'
          and 'tau12' 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 'NA's. The default action ('na.fail') causes 
          'DPMmeta' to print an error message and terminate if there
          are any incomplete observations.

_D_e_t_a_i_l_s:

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


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


           sigma^-1 | tau01, tau02 ~ Gamma(tau01/2,tau02/2)


              thetai | G, sigma ~ int N(mu,sigma)G(d mu)


                     G | alpha, G0 ~ DP(alpha G0)


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

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


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


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


          sigma^-1_b | tau11, tau12 ~ Gamma(tau11/2,tau12/2)


     The precision or total mass parameter, alpha, 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  for a collapsed state of MacEachern (1998). 

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

_V_a_l_u_e:

     An object of class 'DPMmeta' 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', 'sigma', 'mub', 'sigmab', '\alpha', and
     the  number of clusters.

     The function 'DPMrandom' 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 (nrec) giving the value of the random
          effects for each subject.

      mu: a vector of dimension (nrec) giving the value of the mean of
          the normal kernel for each cluster (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.

   sigma: giving the variance of the normal kernel.

     mub: giving the mean of the normal baseline distributions.

  sigmab: giving the variance of the normal baseline distributions.

_A_u_t_h_o_r(_s):

     Alejandro Jara <Alejandro.JaraVallejos@med.kuleuven.be>

_R_e_f_e_r_e_n_c_e_s:

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

     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. 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.

_S_e_e _A_l_s_o:

     'DPMrandom', 'DPmeta'  'DPMglmm', 'DPMolmm', 'DPlmm'  , 'DPglmm',
     'DPolmm'

_E_x_a_m_p_l_e_s:

     ## 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,
                       tau01=20,
                       tau02=10,
                       tau11=20,
                       tau12=10,
                       mb=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<-DPMmeta(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)

