Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/nbinomDeviance.R

Fit the same log-link negative binomial or Poisson generalized linear model (GLM) to each row of a matrix of counts.

1 | ```
nbinomDeviance(y, mean, dispersion=0, weights=NULL)
``` |

`y` |
numeric matrix containing the negative binomial counts, with rows for genes and columns for libraries. A vector will be treated as a matrix with one row. |

`mean` |
numeric matrix of expected values, of same dimension as |

`dispersion` |
numeric vector or matrix of negative binomial dispersions, as for |

`weights` |
numeric vector or matrix of non-negative weights, as for |

Computes the total residual deviance for each row of `y`

, i.e., weighted row sums of the unit deviances.

Care is taken to ensure accurate computation in limiting cases when the dispersion is near zero or `mean*dispersion`

is very large.

`nbinomDeviance`

returns a numeric vector of length equal to the number of rows of `y`

.

Gordon Smyth, Yunshun Chen, Aaron Lun. C++ code by Aaron Lun.

Jorgensen, B. (2013). Generalized linear models. Encyclopedia of Environmetrics 3, Wiley. http://onlinelibrary.wiley.com/doi/10.1002/9780470057339.vag010.pub2/abstract.

McCarthy, DJ, Chen, Y, Smyth, GK (2012).
Differential expression analysis of multifactor RNA-Seq experiments with respect to biological variation.
*Nucleic Acids Research* 40, 4288-4297.
http://nar.oxfordjournals.org/content/40/10/4288

1 2 3 | ```
y <- matrix(1:6,3,2)
mu <- matrix(3,3,2)
nbinomDeviance(y,mu,dispersion=0.2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.