predict.bmixlm: Predicted Values for a 'bmixlm' Object

Description Usage Arguments Details Value

Description

Calculate the predicted values that can be computed from a fitted model.

Usage

1
2
3
## S3 method for class 'bmixlm'
predict(object, newdata = NULL, type = c("mean",
  "samples"), ...)

Arguments

object

An object of class bmixlm

newdata

A dataframe for which predictions are required

type

Whether to return the posterior mean or samples from the posterior.

...

Currently unused.

Details

This function returns the predicted values conditional on the original observed data and the prediction covariates only. An expanded range of predictions that include quantities conditional on the observed responses in the prediction data can be calculated with predictAll.

If type="mean" the function returns posterior mean quantities as a dataframe, otherwise it returns samples from the posterior as a list of arrays.

Value

Returns a list or dataframe with elements

y1

predicted values for the first component model

y2

predicted values for the second component model

p

posterior predictive probabilities of membership of the second component

If type="mean" return a dataframe of posterior means is returned, and if type="samples" return a list of arrays of samples from the posterior.


SWotherspoon/bmixlm documentation built on May 9, 2019, 12:07 p.m.