Learn R Programming

CARBayes (version 4.2)

summarise.lincomb: Compute the posterior distribution for a linear combination of the covariates from the linear predictor.

Description

This function takes in a `carbayes' model object and computes the posterior distribution and posterior quantiles of a linear combination of the covariates from the linear predictor. For example, if a quadratic effect of a covariate on the response was specified, then this function allows you to compute the posterior distribution of the quadratic relationship.

Usage

summarise.lincomb(model, columns=NULL, quantiles=0.5, distribution=FALSE)

Arguments

model
A `carbayes' model object from fitting one of the models in this package.
columns
A vector of column numbers stating which columns in the design matrix of covariates the posterior distribution should be computed for.
quantiles
The vector of posterior quantiles required.
distribution
A logical value stating whether the entire posterior distribution should be returned or just the specified quantiles.

Value

  • quantilesA 2 dimensional array containing the requied posterior quantiles. Each row relates to a data value, and each column to a different requested quantile.
  • posteriorA 2 dimensional array containing the requied posterior distribution. Each column relates to a different data value.

Examples

Run this code
## See the vignette accompanying this package for an example of its use.

Run the code above in your browser using DataLab