Re: [R] Simulating the p-value of a test statistic

From: Duncan Murdoch <>
Date: Sat, 24 May 2008 22:02:29 -0400 wrote:
> The context is "goodness-of-fit techniques"
> Suppose I want to know whether a sample of data comes from
> say an exponential distribution or not.
> I have a test statistic T, but I do not know its cummulative
> distribution.
> Suppose an observed value of T is t
> How do I find the p-value in this case by simulation?
> that is how do I find P(T>t)

Simulate 1000 (or 100000) values of T for which the null is true, and see where t falls in that distribution.

Duncan Murdoch mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun 25 May 2008 - 02:11:24 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 Sun 25 May 2008 - 03:30:40 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive