estimateGLMRobustDisp(y, design = NULL, prior.df = 10, update.trend = TRUE,
trend.method = "bin.loess", maxit = 6, k = 1.345,
residual.type = "pearson", verbose = FALSE,
record = FALSE)
DGEList
object.glmFit
.estimateGLMTrendedDisp
estimateGLMTagwiseDisp
.k/abs(r)
.estimateGLMRobustDisp
produces a DGEList
object, which contains the (robust) genewise dispersion parameter estimate for each gene for the negative binomial model that maximizes the weighted Cox-Reid adjusted profile likelihood, as well as the observation weights. The observation weights are calculated using residuals and the Huber function.Note that when record=TRUE
, a simple list of DGEList
objects is returned, one for each iteration (this is for debugging or tracking purposes).
The robustly computed genewise estimates are reported in the tagwise.dispersion
vector of the returned DGEList
.
The terms `tag' and `gene' are synonymous in this context.
Note: it is not necessary to first calculate the common, trended and genewise dispersion estimates. If these are not available, the function will first calculate this (in an unweighted) fashion.
estimateGLMTrendedDisp
and
estimateGLMTagwiseDisp
.y <- matrix(rnbinom(100*6,mu=10,size=1/0.1),ncol=6)
d <- DGEList(counts=y,group=c(1,1,1,2,2,2),lib.size=c(1000:1005))
d <- calcNormFactors(d)
design <- model.matrix(~group, data=d$samples) # Define the design matrix for the full model
d <- estimateGLMRobustDisp(d, design)
summary(d$tagwise.dispersion)
Run the code above in your browser using DataLab