I have a vector of observations and would like to obtain an empirical p value of each obervation with R. I don't know the underlying distribution, and what I currently do is just
runif(100,0,1000)->ay
quantile(ay)
However, that does not really give me a p-value. How can I obtain a p-value empirically?
I think what you want is the
ecdf
function. This returns an empirical cumulative distribution function, which you can apply directlyAnd then