# cprob

From R2BayesX v1.1-1
by Nikolaus Umlauf

##### Extract Contour Probabilities

Function to extract estimated contour probabilities of a particular effect estimated with
P-splines using Markov chain Monte Carlo (MCMC) estimation techniques. Note that, the contour
probability option must be specified within function `sx`

, see the example.

- Keywords
- regression

##### Usage

`cprob(object, model = NULL, term = NULL, ...)`

##### Arguments

- object
an object of class

`"bayesx"`

.- model
for which model the contour probabilities should be provided, either an integer or a character, e.g.

`model = "mcmc.model"`

.- term
if not

`NULL`

, the function will search for the term contour probabilities should be extracted for, either an integer or a character, eg`term = "s(x)"`

.- …
not used.

##### References

Brezger, A., Lang, S. (2008): Simultaneous probability statements for Bayesian P-splines.
*Statistical Modeling*, **8**, 141--186.

##### See Also

##### Examples

```
# NOT RUN {
## generate some data
set.seed(111)
n <- 500
## regressor
dat <- data.frame(x = runif(n, -3, 3))
## response
dat$y <- with(dat, 1.5 + sin(x) + rnorm(n, sd = 0.6))
## estimate model
## need to set the contourprob option,
## otherwise BayesX will not calculate probabilities
## see also the reference manual of BayesX available
## at www.BayesX.org
b <- bayesx(y ~ sx(x, bs = "ps", contourprob = 4), data = dat)
## extract contour probabilities
cprob(b, term = "sx(x)")
# }
```

*Documentation reproduced from package R2BayesX, version 1.1-1, License: GPL-2 | GPL-3*

### Community examples

Looks like there are no examples yet.