| sample.sm | R Documentation |
Use this model when each sample has its own external scale measurement, such
as a flow-cytometry cell count, qPCR concentration, or spike-in estimate.
Put the log2 measurement for each sample in s.mu. Use s.sd to
describe the measurement uncertainty for each sample.
sample.sm(
X,
logComp,
s.mu = NULL,
s.var = NULL,
s.cor = NULL,
s.sd = NULL,
s.cov = NULL
)
X |
Model matrix passed automatically by |
logComp |
Monte Carlo log-compositions passed automatically by
|
s.mu |
Expected log2 scale for each sample, in the same order as the
columns of the count matrix. Must have length |
s.var |
Deprecated numeric vector of per-sample log2-scale variances.
Use |
s.cor |
Deprecated |
s.sd |
SD of the log2 scale for each sample. Must have length |
s.cov |
An |
For example, if four samples have estimated total cell counts of
1e8, 2e8, 8e7, and 1.5e8, set
s.mu = log2(c(1e8, 2e8, 8e7, 1.5e8)). If each measurement has an SD
of 0.5 on the log2 scale, set s.sd = rep(0.5, 4).
Use s.sd when measurement errors are independent. Use s.cov
instead when errors are correlated, for
example because several samples share a calibration standard. The diagonal
of s.cov contains variances, and its off-diagonal entries contain
covariances. Thus independent SDs of 0.5 can also be written as
s.cov = diag(0.5^2, 4).
Supply exactly one of s.sd or s.cov. With s.sd, each
sample receives its own independent scale draw. Samples in the same group
do not automatically share uncertainty as they do in coefficient-based
models.
A numeric matrix of dimension N x nsample giving Monte Carlo
draws of the log2 scale for each sample (rows) across nsample draws
(columns).
Kyle McGovern
# External total-cell estimates for four samples.
cell_count <- c(1e8, 2e8, 8e7, 1.5e8)
X <- matrix(1, 1, 4)
logComp <- array(0, c(2, 4, 10))
logScale <- sample.sm(
X, logComp, s.mu = log2(cell_count), s.sd = rep(0.5, 4)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.