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

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Sat, 24 May 2008 22:02:29 -0400

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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive