DPcaterpillar           package:DPpackage           R Documentation

_C_a_t_e_r_p_i_l_l_a_r _P_l_o_t_s _f_o_r _R_a_n_d_o_m _E_f_f_e_c_t_s

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

     This generic function produces Caterpillar Plots for Random
     Effects from  DPrandom objects.

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

     DPcaterpillar(object, midpoint="mean", hpd=TRUE , ask=TRUE, 
                   nfigr=1, nfigc=1, ...)

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

  object: DPrandom object from which random effects estimates can be
          extracted.

midpoint: variable indicating whether the mean or median  of the
          posterior distribution of random effects should be considered
          as "midpoint" in the caterpillar plot.

     hpd: logical variable indicating whether the hpd (TRUE) or  pd
          (FALSE) of random effects should be considered in the
          caterpillar plot.

     ask: logical variable indicating whether the caterpillar plots
          should be display gradually (TRUE) or not (FALSE).

   nfigr: integer variable indicating the number of caterpillar plots
          by row.

   nfigc: integer variable indicating the number of caterpillar plots
          by column.

     ...: further arguments passed to or from other methods. 

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

     ## Not run: 
         # School Girls Data Example

           data(schoolgirls)
           attach(schoolgirls)

         # Prior information
         # Prior information

           tinv<-diag(10,2)
           prior<-list(alpha=1,nu0=4.01,tau1=0.001,tau2=0.001,
           tinv=tinv,mub=rep(0,2),Sb=diag(1000,2))

         # Initial state
           state <- NULL

         # MCMC parameters

           nburn<-5000
           nsave<-25000
           nskip<-20
           ndisplay<-1000
           mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,
                        ndisplay=ndisplay)

         # Fit the model
         
           fit1<-DPlmm(fixed=height~1,random=~age|child,prior=prior,
                       mcmc=mcmc,state=state,status=TRUE)
           fit1

         # Extract random effects
         
           DPcaterpillar(DPrandom(fit1))
     ## End(Not run)

