Entering edit mode
Ramon Diaz
★
1.1k
@ramon-diaz-159
Last seen 10.2 years ago
hits=-2.6 tests?YES_00
X-USF-Spam-Flag: NO
Dear All,
I am trying to understand how the ACME package (by Sean Davis) works,
but I
think there is something I am missing about the way the p-values are
computed. It seems when I try to do the chi-square test myself, I
always
overestimate the p-value.
The following is a complete example:
silly.dat <- c(2, 1, 5, 3, 6, 4)
dummy.data <- new("aGFF", data = matrix(silly.dat, ncol = 1),
annotation = data.frame(Chromosome = 1,
Location = c(1, 10, 20, 1000, 1200,
1300)),
samples = data.frame(SampleID = 1))
### So we have
cbind(silly.dat, Position = c(1, 10, 20, 1000, 1200, 1300))
silly.dat Position
[1,] 2 1
[2,] 1 10
[3,] 5 20
[4,] 3 1000
[5,] 6 1200
[6,] 4 1300
do.aGFF.calc(dummy.data, window = 110, thresh = 0.90)
### Cutpoints:
### [1] 5.5
### Thus, all values except 6 (the fifth value) are below the
threshold
## Within the window for fifth value we have:
## only value of 6
do.aGFF.calc(dummy.data, window = 10, thresh = 0.90)@vals[5] ## 0.0877
chisq.test(x = c(0, 1), p = as.vector(table(silly.dat > 5.5)/6)) ##
0.02535
## value of 6 and 4
do.aGFF.calc(dummy.data, window = 202, thresh = 0.90)@vals[5] ##
0.3458
chisq.test(x = c(1, 1), p = as.vector(table(silly.dat > 5.5)/6)) ##
0.2059
## values 6, 4, 3
do.aGFF.calc(dummy.data, window = 402, thresh = 0.90)@vals[5] ## 0.571
chisq.test(x = c(2, 1), p = as.vector(table(silly.dat > 5.5)/6)) ##
0.4386
Where am I computing the chisq in the wrong way?
Thanks,
R.
--
Ram?n D?az-Uriarte
Statistical Computing Team
Centro Nacional de Investigaciones Oncol?gicas (CNIO)
(Spanish National Cancer Center)
Melchor Fern?ndez Almagro, 3
28029 Madrid (Spain)
Fax: +-34-91-224-6972
Phone: +-34-91-224-6900
http://ligarto.org/rdiaz
PGP KeyID: 0xE89B3462
(http://ligarto.org/rdiaz/0xE89B3462.asc)
**NOTA DE CONFIDENCIALIDAD** Este correo electr?nico, y
...{{dropped:3}}