Learn R Programming

ocomposition (version 1.1)

predict.composition: Predicted compositional vector

Description

Computes the predicted composition given a vector of covariates newdata.

Usage

"predict"(object, newdata, n.method = "median", l.bound = NULL, ...)

Arguments

object
Object of class composition from the previous call offitcomp.
newdata
data.frame of predictors.
n.method
If "median" (default), then the number of components is set to the median of the truncated negative binomial distribution, conditional on the estimated parameters; alternatively, it can be set to "mode."
l.bound
Set the lower bound for predicted number of components. If NULL (default), then l.bound is taken from the composition object.
...
additional arguments

Value

Matrix of predicted probabilities of for each component. Rows are MCMC iterations and columns are the components.