numeric matrix giving the design matrix for the GLM that is to be fit.
offset
numeric scalar, vector or matrix giving the offset (in addition to the log of the effective library size) that is to be included in the NB GLM for the genes. If a scalar, then this value will be used as an offset for all genes and libraries. If a vector, it should be have length equal to the number of libraries, and the same vector of offsets will be used for each gene. If a matrix, then each library for each gene can have a unique offset, if desired. In adjustedProfileLik the offset must be a matrix with the same dimension as the table of counts.
df
integer giving the degrees of freedom of the spline function, see ns in the splines package.
subset
integer, number of rows to use in the calculation. Rows used are chosen evenly spaced by AveLogCPM using cutWithMinN.
AveLogCPM
numeric vector giving average log2 counts per million for each gene.
method.optim
the method to be used in optim. See optim for more detail.
trace
logical, should iteration information be output?
Details
In the edgeR context, these are low-level functions called by estimateGLMTrendedDisp.
dispCoxReidSplineTrend and dispCoxReidPowerTrend fit abundance trends to the genewise dispersions.
dispCoxReidSplineTrend fits a regression spline whereas dispCoxReidPowerTrend fits a log-linear trend of the form a*exp(abundance)^b+c.
In either case, optim is used to maximize the adjusted profile likelihood (Cox and Reid, 1987).
Value
List containing numeric vectors dispersion and abundance containing the estimated dispersion and abundance for each gene.
The vectors are of the same length as nrow(y).
Author(s)
Yunshun Chen, Davis McCarthy, Gordon Smyth
References
Cox, DR, and Reid, N (1987). Parameter orthogonality and approximate conditional inference. Journal of the Royal Statistical Society Series B 49, 1-39.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(edgeR)
Loading required package: limma
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/edgeR/dispCoxReidSplineTrend.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dispCoxReidSplineTrend
> ### Title: Estimate Dispersion Trend for Negative Binomial GLMs
> ### Aliases: dispCoxReidSplineTrend dispCoxReidPowerTrend
> ### Keywords: models
>
> ### ** Examples
>
> design <- matrix(1,4,1)
> y <- matrix((rnbinom(400,mu=100,size=5)),100,4)
> d1 <- dispCoxReidSplineTrend(y, design, df=3)
> d2 <- dispCoxReidPowerTrend(y, design)
> with(d2,plot(AveLogCPM,sqrt(dispersion)))
>
>
>
>
>
> dev.off()
null device
1
>