[R] Probability of data values form DENSITY function

Rolf Turner r.turner at auckland.ac.nz
Tue Sep 29 20:53:57 CEST 2009


On 30/09/2009, at 3:45 AM, Lina Rusyte wrote:

> Hello,
>
> Could someone help me please and to tell how to get the probability  
> from empirical DENSITY (not parametric) for each data value (R  
> function).
> For example, for normal distribution there is such a function like:
>
> “dnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)”
>
> I need the same function only for the empirical DENSITY function  
> (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.

(1) Please be aware that these are ***NOT*** probabilities that you  
after.  The
values of a density function are, strange to tell, probability  
***densities***
and not probabilties.

(2) Look at the help for density().  I.e., RTFM.

	cheers,

		Rolf Turner
######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com
######################################################################




More information about the R-help mailing list