Re: [R] Table of P values for Fisher's exact test

From: Jacques VESLOT <jacques.veslot_at_good.ibl.fr>
Date: Tue 11 Jul 2006 - 19:41:37 EST

apply(yourdata[, c("X2N_CHB","X2N_AA","Counts_CHB","Counts_AA")], 1, function(x) fisher.test(cbind(x[3:4], x[1:2]-x[3:4]))$p.value)



Jacques VESLOT

CNRS UMR 8090
I.B.L (2ème étage)
1 rue du Professeur Calmette
B.P. 245
59019 Lille Cedex

Tel : 33 (0)3.20.87.10.44
Fax : 33 (0)3.20.87.10.31

http://www-good.ibl.fr


jenny tan a écrit :
> Hi,
>
> I have a table of observed counts for various genetic markers. Instead of
> doing Fisher's exact test for each marker one at a time and recording the P
> value manually, is there a script to go through the whole list and generate
> the P value column automatically?
>
> An example of my data:
>
>
> Counts_CHB and Counts_AA are the observed counts for one allele.
> 2N_CHB and 2N_AA are the total number of alleles.
>
> gene Local_Pos 2N_CHB 2N_AA Counts_CHB Counts_AA Exact_P
> B2M 2475 90 46 0 5
> B2M 3532 90 44 0 1
> FCN2 2203 88 46 0 1
> FCN2 3536 90 46 0 9
> FCN2 4027 84 46 0 9
> FCN2 4036 90 46 0 9
> FCN2 4318 90 46 0 9
> FCN2 4392 90 46 0 9
> FCN2 9575 90 46 0 1
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 11 19:44:57 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 16 Jul 2006 - 06:14:44 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.