Two-sided significant test for null models
On 07/23/2013 12:06 PM, Cayetano Guti?rrez C?novas wrote:
Dear all, I'd like to test the two-side significance of an observed value being lower or higher in comparison to a null distribution, but I don't know how to build this in R code. Can anybody help me with some code or any R function? Let's say 'null.dist' the null distribution, 'obs' the observed value and 'alpha' the probability of Type I error. set.seed(10) rnorm(999)->null.dist obs<-1.5 alpha<-0.05
pval=mean(obs>null.dist) min(pval, 1-pval)<0.05 Bob
Bob O'Hara Biodiversity and Climate Research Centre Senckenberganlage 25 D-60325 Frankfurt am Main, Germany Tel: +49 69 7542 1863 Mobile: +49 1515 888 5440 WWW: http://www.bik-f.de/root/index.php?page_id=219 Blog: http://blogs.nature.com/boboh Journal of Negative Results - EEB: www.jnr-eeb.org