[R] Calculating p-values from your own distribution as an array

Stephen Montgomery sm8 at sanger.ac.uk
Fri Jan 9 17:29:28 CET 2009


Hi -

If I have a hypothetical distribution as an array

distribution<-c(0,1,2,3,4,5,6,7,8,9)

and I want to find the probability there is a value smaller than a new
value.

new_value<-4

(such that I'd get this type of output)

new_value	p-value
4	0.5
3.4	0.4	
3	0.4
0	0.1
-1	0.0

Thanks for the help, I bet this is really easy... :/ 

Stephen


-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE.




More information about the R-help mailing list