fitNbinomGLMs {DESeq} | R Documentation

## Fit a generalized linear model (GLM) for each gene.

### Description

Use this function to estimate coefficients and calculate deviance from a GLM for each gene. The GLM uses the `nbkd.sf` family, with the dispersion estimate according to `getVarianceFunction(cds)`. Note that this requires that the variance functions were estimated with method "pooled" or "blind".

### Usage

    fitNbinomGLMs( cds, modelFormula, glmControl=list() )

### Arguments

`cds` | a CountDataSet
`modelFormula` | a formula. The left hand side must be 'count' (not 'counts'!), the right hand side can involve any column of `pData(cds)`, i.e., `pData(cds)` is used as the model frame. If you have passed just a single factor to the 'conditions' argument of `newCountDataSet`, it can be referred to as 'condition' in the formula. If you have passed a data frame to 'conditions', all columns of this data frame will be available.
`glmControl` | list of additional parameters to be passed to `glm.control`

### Value

A data frame with one row for each gene and columns as follows:

- one column for each estimated coefficient, on a log2 scale (i.e., the natural log reported by `glm` is rescaled to base 2)

- a column 'deviance', with the deviance of the fit

- a boolean column 'converged', indicating whether the fit converged

Furthermore, the data frame has a scalar attribute 'df.residual' that contains the number of residual degrees of freedom.

### Author(s)

Simon Anders (sanders@fs.tum.de)

### See Also

`newCountDataSet`,`nbinomGLMTest`, `nbkd.sf`

### Examples

       # see nbinomGLMTest for an example

[Package DESeq version 1.36.0 Index]