Skip to contents

The function summarises only samples that are not marked as burnin in samples(.)

Usage

# S3 method for class 'mcmcglm'
quantile(x, probs = c(0.025, 0.5, 0.975), ...)

Arguments

x

an mcmcglm object

probs

numeric vector of probabilities with values in \([0,1]\). (Values up to 2e-14 outside that range are accepted and moved to the nearby endpoint.)

...

further arguments passed to or from other methods.

Examples

if (FALSE) { # \dontrun{
# Create test data
n <- 100
x1 <- rnorm (n)
x2 <- rbinom (n, 1, .5)
b0 <- 1
b1 <- 1.5
b2 <- 2
lin_pred <- b0+b1*x1+b2*x2

# For family "gaussian" and iid normal prior
y_norm <- rnorm(n, mean = lin_pred, sd = 1)
dat_norm <- data.frame(Y = y_norm, X1 = x1, X2 = x2)

norm <- mcmcglm(formula = Y ~ .,
                   data = dat_norm,
                   beta_prior = distributional::dist_normal(0, 1),
                   family = "gaussian",
                   n_samples = 100,
                   burnin = 10,
                   sample_method = "slice_sampling",
                   qslice_fun = qslice::slice_stepping_out,
                   w = 0.5)
quantile(norm)
} # }