Discussion:
[R-sig-ME] Simulations in Fisher's Exact test
Adeela Munawar
2018-10-28 11:47:02 UTC
Permalink
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]]
Ben Bolker
2018-10-28 16:18:44 UTC
Permalink
This is indeed the wrong list; r-***@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 ..
Post by Adeela Munawar
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]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Alexandre Courtiol
2018-10-29 11:11:24 UTC
Permalink
Message: 2
Date: Sun, 28 Oct 2018 12:18:44 -0400
Subject: Re: [R-sig-ME] Simulations in Fisher's Exact test
Content-Type: text/plain; charset="utf-8"
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
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 ..
Post by Adeela Munawar
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]]
_______________________________________________
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]]

Loading...