Description Usage Arguments Value Examples
Get predicted OTU abundances
1 2 3 4 5 6 7 8 9 |
object |
An object of class |
newdata |
An optional numeric matrix containing covariates for new observations to get predictions for. |
type |
Character specifying what scale to get predicted OTU abundances for. Additive log-ratios or proportions? |
post.stat |
Character specifying whether the predictions be based on the posterior mean or median. |
quant |
Numeric vector specifying the quantiles of the posterior to return for the OTU abundances. |
... |
Further arguments passed to or from other methods |
A list containing:
fit
: A matrix containing the posterior mean (or median) of the OTU abundances on the appropriate scale
quant
: A list containing the requested quantiles from the posterior mean for the OTU abundances.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | n <- 50
p <- 5
X <- cbind(1, rnorm(n))
counts <- matrix(0, n, p+1)
for (i in 1:n) {
counts[i,] <- rmultinom(1, size=100, prob=rep(1,p+1))
}
library(micore)
mc.fit <- micore(counts, X, n.samp=100, n.burn=100, n.chain=1)
new.dat <- cbind(c(1,1,1),c(0,1,0))
pred <- predict(mc.fit, newdata = new.dat)
pred.p <- predict(mc.fit, newdata=new.dat, "prop")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.