linpred: Generate predicted values from posterior samples for new...

Description Usage Arguments Value Examples

Description

Note that this just generates the posterior for the predicted means / expected values. for a set of new observations. This is not a posterior predictive distribution generator, which draws samples from the outcome distribution. Hence, credible intervals for predictions derived in this function represent the credible intervals for the mean regression line, not the posterior predictive distribution which would have considerably wider intervals.

Usage

1
linpred(samples, formula, newdata, link = "identity")

Arguments

samples

a matrix of MCMC samples containing the intercept and coefficients

formula

the formula used for the original model

newdata

a data frame of new data

link

the link function used for the original model. For normal, student's t, laplace and similar use "identity". For poisson glms use "log". For binomial models use either "logitProb" if you want the predicted probabilities or "logitBin" if you want the classifications split into the binary outcome, such that predicted probabilities < .50 are 0 and prob. > .50 are 1.

Value

a matrix

Examples

1
linpred(posterior, Sepal.Length ~ ., iris[testset,], "identity" )

abnormally-distributed/Bayezilla documentation built on Oct. 31, 2019, 1:57 a.m.