# True dispersion is 1/size=0.1
y <- matrix(rnbinom(1000,mu=10,size=10),ncol=4)
d <- DGEList(counts=y,group=c(1,1,2,2))
design <- model.matrix(~group, data=d$samples)
d1 <- estimateGLMCommonDisp(d, design, verbose=TRUE)
# Compare with classic CML estimator:
d2 <- estimateCommonDisp(d, verbose=TRUE)
# See example(glmFit) for a different example
Run the code above in your browser using DataLab