# sage.test

From statmod v1.4.4
by Gordon Smyth

##### Compare Two SAGE Libraries

Compute p-values for differential expression for each tag between two serial analysis of gene expression (SAGE) libraries.

- Keywords
- htest

##### Usage

`sage.test(x, y, n1=sum(x), n2=sum(y))`

##### Arguments

- x
- integer vector giving counts in first library. Non-integer values are rounded to the nearest integer.
- y
- integer vector giving counts in second library. Non-integer values are rounded to the nearest integer.
- n1
- total number of tags in first library. Non-integer values are rounded to the nearest integer.
- n2
- total number of tags in second library. Non-integer values are rounded to the nearest integer.

##### Details

SAGE is a method for counting the frequency of sequence tags in samples of RNA.
One can test for differential expression for a given tag between the SAGE results for two different RNA samples using Fisher's exact test.
This is however computationally intensive when the SAGE libraries are large.
This function uses a binomial approximation to the Fisher Exact test for each tag.
The approximation is accurate when `n1`

and `n2`

are large and `x`

and `y`

are small in comparison.

##### Value

- Numeric vector of p-values.

##### References

##### See Also

##### Examples

```
sage.test(c(0,5,10),c(0,30,50),n1=10000,n2=15000)
# Exact equivalents
fisher.test(matrix(c(0,0,10000-0,15000-0),2,2))$p.value
fisher.test(matrix(c(5,30,10000-5,15000-30),2,2))$p.value
fisher.test(matrix(c(10,50,10000-10,15000-50),2,2))$p.value
```

*Documentation reproduced from package statmod, version 1.4.4, License: LGPL (>= 2)*

### Community examples

Looks like there are no examples yet.