Description Usage Arguments Details See Also
View source: R/mean_efficiency.R
Given a matrix of 'observed' or 'actual' (e.g. calibrated) abundance profiles and a vector of relative efficiencies, compute the estimated mean efficiency for each sample.
1 2 3 4 5 6 7 8 9 10 11 12 13 | mean_efficiency(x, ...)
## S3 method for class 'matrix'
mean_efficiency(x, bias, margin, type)
## S3 method for class 'otu_table'
mean_efficiency(x, bias, type)
## S3 method for class 'phyloseq'
mean_efficiency(x, bias, type)
## S3 method for class 'mc_bias_fit'
mean_efficiency(x, newdata = NULL, margin = NULL, type = NULL)
|
x |
A matrix, a phyloseq object with an otu_table, or an object of class 'mc_bias_fit' |
bias |
A (possibly named) numeric vector of relative efficiencies |
margin |
The margin containing the samples (observations) |
type |
'actual' or 'observed', indicating the type of abundance
profiles in the matrix |
newdata |
NULL or an abundance matrix |
The mean efficiency of a sample equals weighted.mean(bias, y)
, where
bias
is the vector of taxa efficiencies and y
is the vector of taxa
proportions.
The type %in% c('actual', 'observed')
specifies whether the data is
'actual' (i.e. nominally known or calibrated abundances) or 'observed' (i.e.
uncalibrated) data. 'Observed' data is calibrated to determine y
prior to
computing the mean efficiency.
If x
is an mc_bias_fit
object, then the efficiencies will be extracted
with coef(x)
. An abundance matrix can optionally be given with newdata
;
otherwise, the mean efficiency will be computed for the control samples in
x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.