betaplot {CoMiRe}R Documentation

\beta(x) plot

Description

Posterior mean (continuous lines) and pointwise credible bands (shaded areas) for \beta(x).

Usage

betaplot(x, fit, x.grid = NULL, xlim = c(0, max(x)), xlab = "x")

Arguments

x

numeric vector for the covariate relative to the dose of exposure used in comire.gibbs.

fit

the output of comire.gibbs opportunely trasformed in classCoMiRe class.

x.grid

optional numerical vector giving the actual values of the grid for x for plotting \beta(x). If x.gird is not provided, standard grids are automatically used.

xlim

numeric vectors of length 2, giving the x coordinates ranges for the plot.

xlab

the title of the x axis.

Author(s)

Antonio Canale

Examples

{
data(CPP)
attach(CPP)

n <- NROW(CPP)
J <- H <- 10

premature <- as.numeric(gestage<=37)

mcmc <- list(nrep=5000, nb=2000, thin=5, ndisplay=4)

## too few iterations to be meaningful. see below for safer and more comprehensive results

mcmc <- list(nrep=10, nb=2, thin=1, ndisplay=4) 

prior <- list(mu.theta=mean(gestage), k.theta=10, eta=rep(1, J)/J, 
              alpha=rep(1,H)/H, a=2, b=2, J=J, H=H)
              
fit.dummy <- comire.gibbs(gestage, dde, family="continuous", 
                     mcmc=mcmc, prior=prior, seed=1, max.x=180)
                     
betaplot(x=dde, fit=fit.dummy, x.grid=seq(0,180, length=100), xlim=c(0,150))


## safer procedure with more iterations (it may take some time)

mcmc <- list(nrep=5000, nb=2000, thin=5, ndisplay=4)

## Fit the model for continuous y 

prior <- list(mu.theta=mean(gestage), k.theta=10, eta=rep(1, J)/J, 
              alpha=rep(1,H)/H, a=2, b=2, J=J, H=H)
              
fit1 <- comire.gibbs(gestage, dde, family="continuous", 
                     mcmc=mcmc, prior=prior, seed=5, max.x=180)

                         
betaplot(x=dde, fit=fit1, x.grid=seq(0,180, length=100), xlim=c(0,150))


}

[Package CoMiRe version 0.8 Index]