# Re: Previously attainable fisher's exact test

6 messages
Open this post in threaded view
|

## Re: Previously attainable fisher's exact test

 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.         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Previously attainable fisher's exact test

 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) <[hidden email]> Fax-to-email: +44 (0)870 094 0861 Date: 14-Apr-11                                       Time: 00:28:59 ------------------------------ XFMail ------------------------------ ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Previously attainable fisher's exact test

 On Apr 14, 2011, at 01:29 , (Ted Harding) wrote: > 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 ... !). > What Ted said, plus f <- fisher.test(M) f\$p.value # [1] 0.3917553 -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: [hidden email]  Priv: [hidden email] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Previously attainable fisher's exact test

 What Ted and Peter did were Fisher's exact test, To get the previous attainable p-value, what you do is  the the fisher exact test p-values of ALL the possible tables with margins fixed and choose the p-value that is just below the one for fisher's exact test of the original table. n Thu, Apr 14, 2011 at 3:01 AM, peter dalgaard <[hidden email]> wrote: > > On Apr 14, 2011, at 01:29 , (Ted Harding) wrote: > > > 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 ... !). > > > > What Ted said, plus > > f <- fisher.test(M) > f\$p.value > # [1] 0.3917553 > > > -- > Peter Dalgaard > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: [hidden email]  Priv: [hidden email] > > -- Thanks, Jim.         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.