The function ecdf(x) computes the empirical cdf from data in the vector x.
You can plot it with plot(ecdf(x)), or compute the emp. cdf at new values,
e.g.
   my.cdf <- ecdf(x)
   my.cdf( 0:3 ) # computes the emp. cdf at 0,1,2,3

John


 ...........................................................................


 John P. Nolan
 Math/Stat Department
 227 Gray Hall
 American University
 4400 Massachusetts Avenue, NW
 Washington, DC 20016-8050

 jpno...@american.edu
 202.885.3140 voice
 202.885.3155 fax
 http://academic2.american.edu/~jpnolan
 ...........................................................................

-----r-devel-boun...@r-project.org wrote: -----
To: R help <r-help@r-project.org>
From: Lina Rusyte
Sent by: r-devel-boun...@r-project.org
Date: 09/29/2009 04:51AM
Cc: R devel <r-de...@r-project.org>
Subject: [Rd] Probability of data values form empirical distribution

Hello,
Â
Could someone help me please and to tell how to get the probability from
empirical distribution (not parametric) for each data value (R function).
For example, for normal distribution there is such a function like:
Â
“pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)”
Â
I need the same function only for the empirical distribution (which does
not correspond to any typical distribution).
R plots the density function of any data:
Â
“plot(density(x))”
Â
I need to find out the probability for each data value from this plot-line.
Â
Best regards,
Lina



 [[alternative HTML version deleted]]


______________________________________________
r-de...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
        [[alternative HTML version deleted]]

______________________________________________
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