[R] p-value for y in non-parametric distribution, Y

Sascha Vieweg saschaview at gmail.com
Tue Feb 8 20:49:08 CET 2011


On 11-02-07 19:21, Sascha Vieweg wrote:

> Hello, knowing that some index y, with y(341)=2, SE=3, is t-distributed, I 
> (think I) can find an appropriate (left/one-sided) p-value with
>
> R:  y <- 2
> R:  yse <- 3
> R:  (p <- 1-pt(y/yse, df=341))
>
> Now, some simulation resulted in the non-parametric distribution, Y, of my 
> index, y:
>
> R: Y <- rnorm(21277)
>
> How can I find the p-value of y then? Simply counting? Thanks, *S*

For the files: function ecdf() was the function I was looking for.

q.fun <- function(dist, val){
   fn <- ecdf(dist)
   return(fn(val))
}

q.fun(Y, y)



More information about the R-help mailing list