Re: [R] calculating probability from the density function

2012-10-01 Thread Greg Snow
You may find it easier to use the logspline density fits (logspline package) rather than the kernel density estimators for this. On Mon, Oct 1, 2012 at 7:46 AM, Eugene Kanshin wrote: > Hello, > I have a data x with normal (or very close to normal) distribution, I can > plot a density distribution

Re: [R] calculating probability from the density function

2012-10-01 Thread David Winsemius
On Oct 1, 2012, at 6:46 AM, Eugene Kanshin wrote: > Hello, > I have a data x with normal (or very close to normal) distribution, I can > plot a density distribution with density(x,...). My question is is there > any way to calculate an area under this distribution (=probability) for > particular

Re: [R] calculating probability from the density function

2012-10-01 Thread Bert Gunter
Forget density(). Smooth the ecdf instead. ?lowess ?smooth.spline ?monotone.smooth (in package fda, for monotone smoothing, which may be preferable) ?locfit (in package locfit) ... and many many others -- Bert On Mon, Oct 1, 2012 at 6:46 AM, Eugene Kanshin wrote: > Hello, > I have a data x wit

[R] calculating probability from the density function

2012-10-01 Thread Eugene Kanshin
Hello, I have a data x with normal (or very close to normal) distribution, I can plot a density distribution with density(x,...). My question is is there any way to calculate an area under this distribution (=probability) for particular range of x values, let's say for x from 0 to 2? I was not able

Re: [R] calculating probability

2009-08-24 Thread David Winsemius
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

Re: [R] calculating probability

2009-08-24 Thread Uwe Ligges
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)?? Do you want to estimate any distribution or do you just want the empirical informati

[R] calculating probability

2009-08-24 Thread maram salem
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)?? Thanks Maram [[alternative HTML version deleted]] __