[R-sig-ME] Simulations in Fisher's Exact test

Alexandre Courtiol @lex@ndre@courtiol @ending from gm@il@com
Mon Oct 29 12:11:24 CET 2018


>
> Message: 2
> Date: Sun, 28 Oct 2018 12:18:44 -0400
> From: Ben Bolker <bbolker using gmail.com>
> To: r-sig-mixed-models using r-project.org
> Subject: Re: [R-sig-ME] Simulations in Fisher's Exact test
> Message-ID: <b9fd6b4b-e9e6-d368-4148-d9762544e169 using gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
>
>   This is indeed the wrong list; r-help using r-project.org, or StackOverflow,
> might be more appropriate.  I am guessing this is an assignment for a
> class?  If so, it might be more useful to get clarification from your
> instructor or teaching assistant (or a colleague in your class). The
> help page for ?fisher.test says:
>
> simulate.p.value: a logical indicating whether to compute p-values by
>           Monte Carlo simulation, **in larger than 2 by 2 tables**.
>
> Emphasis (**) added.  Since you're using a 2x2 table, I'm guessing that
> simulate.p.value has no effect ...  R probably should warn you, but oh
> well ..
>
>
> On 2018-10-28 7:47 a.m., Adeela Munawar wrote:
> > hi all,
> > Probably I am posted in wrong mailing list. I am getting a problem in
> > applying Fisher's exact test. I am applying Fisher's exact test as
> >
> >  ntable<- array(data = c(3, 1, 8,11), dim = c(2,2))
> > fisher.test(ntable)
> >
> > now, I have to repeat the same 10000 times and have to report p-values.
> > Using the arguments simulate.p.value in the command is producing the same
> > results
> > test<-fisher.test(ntable,workspace=20000,simulate.p.value=T,B=10000)
> >
> > what changes I have to made in my model.
> >
> > regards
> > Adeela
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
>
> Adeela, with simulate.p.value = FALSE, the Fisher exact test will attempt
to create all possible contingency tables (keeping marginal sum constant)
to compute the p-value of the test. With simulate.p.value = TRUE (when it
has an effect -> see Ben's comment), it will only sample the space of
possible contingency tables. If the number of possible contingency tables
is not too large, there is not need to use simulate.p.value and if it is
lower than the number of table you simulate, then you should obtain nearly
the same results anyhow. In other words, I don't really understand what you
are trying to achieve but a simple call to fisher.test(ntable) should do
the job.
++
Alex

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list