Re: [R] Previously attainable fisher's exact test

From: Ted Harding <ted.harding_at_wlandres.net>
Date: Thu, 14 Apr 2011 00:29:04 +0100 (BST)


On 13-Apr-11 17:40:53, Jim Silverton wrote:
> I have a matrix say,
>
> 1 4
> 23 30
>
> and I want to find the previously attainable fisher's exact test
> p-value. Is there a way to do this in R?
> --
> Thanks,
> Jim.

I do not understand what you mean by "previously attainable".

As far as that particular matrix is concerned, the fisher.test() function will yield its exact Fisher P-value:

  M <- matrix(c(1, 4, 23, 30), byrow=TRUE, nrow=2)   M

  #      [,1] [,2]
  # [1,]    1    4
  # [2,]   23   30
  fisher.test(M)
  #         Fisher's Exact Test for Count Data
  # data:  M 
  # p-value = 0.3918
  # alternative hypothesis: true odds ratio is not equal to 1 
  # 95 percent confidence interval:
  #  0.006355278 3.653391412 
  # sample estimates:

  # odds ratio
  # 0.3316483

So the P-value is 0.3918 (as attained now, and as attainable at any time previously if you had done the above ... !).

Ted.



E-Mail: (Ted Harding) <ted.harding_at_wlandres.net> Fax-to-email: +44 (0)870 094 0861
Date: 14-Apr-11                                       Time: 00:28:59
------------------------------ XFMail ------------------------------

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 13 Apr 2011 - 23:32:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Apr 2011 - 07:10:29 GMT.

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

list of date sections of archive