On Aug 24, 2009, at 8:11 AM, maram salem wrote:

Hi all,
I've a trivial question. If (q) is a continous variable,actually a vector of 1000 values. how to calculate the probability that q is greater than a specific value, i.e. P(q>45)??

sum(q>45)/1000  # if no NA's in vector
sum(q>45, na.rm=TRUE)/ sum(!is.na(q))  # if NA's in vector

--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@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.

Reply via email to