## 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)")
# ## End(Not run)
Run the code above in your browser using DataLab