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

Duncan Murdoch murdoch at stats.uwo.ca
Sun May 25 04:02:29 CEST 2008


ampad1cb at cmich.edu 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



More information about the R-help mailing list