```
"estimateGLMTagwiseDisp"(y, design=NULL, prior.df=10, trend=!is.null(y$trended.dispersion), span=NULL, ...)
"estimateGLMTagwiseDisp"(y, design=NULL, offset=NULL, dispersion, prior.df=10, trend=TRUE, span=NULL, AveLogCPM=NULL, weights=NULL, ...)
```

y

matrix of counts or a

`DGEList`

object.design

numeric design matrix, as for

`glmFit`

.trend

logical. Should the prior be the trended dispersion (

`TRUE`

) or the common dispersion (`FALSE`

)?offset

offset matrix for the log-linear model, as for

`glmFit`

. Defaults to the log-effective library sizes.dispersion

common or trended dispersion estimates, used as an initial estimate for the tagwise estimates.

prior.df

prior degrees of freedom.

span

width of the smoothing window, in terms of proportion of the data set. Default value decreases with the number of tags.

AveLogCPM

numeric vector giving average log2 counts per million for each tag

weights

optional numeric matrix giving observation weights

...

other arguments are passed to

`dispCoxReidInterpolateTagwise`

.`estimateGLMTagwiseDisp.DGEList`

produces a `DGEList`

object, which contains the tagwise dispersion parameter estimate for each tag for the negative binomial model that maximizes the Cox-Reid adjusted profile likelihood. The tagwise dispersions are simply added to the `DGEList`

object provided as the argument to the function.`estimateGLMTagwiseDisp.default`

returns a vector of the tagwise dispersion estimates.
The prior degrees of freedom determines the weight given to the global dispersion trend. The larger the prior degrees of freedom, the more the tagwise dispersions are squeezed towards the global trend.

Note that the terms `tag' and `gene' are synonymous here. The function is only named `Tagwise' for historical reasons.

This function calls the lower-level function `dispCoxReidInterpolateTagwise`

.

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

`estimateGLMCommonDisp`

for common dispersion or `estimateGLMTrendedDisp`

for trended dispersion in the context of a generalized linear model.`estimateCommonDisp`

for common dispersion or `estimateTagwiseDisp`

for tagwise dispersions in the context of a multiple group experiment (one-way layout).

```
y <- matrix(rnbinom(1000,mu=10,size=10),ncol=4)
d <- DGEList(counts=y,group=c(1,1,2,2),lib.size=c(1000:1003))
design <- model.matrix(~group, data=d$samples) # Define the design matrix for the full model
d <- estimateGLMTrendedDisp(d, design, min.n=10)
d <- estimateGLMTagwiseDisp(d, design)
summary(d$tagwise.dispersion)
```

Run the code above in your browser using DataCamp Workspace