Re: [R] Empirical density estimation

2018-03-11 Thread Jeff Newmiller
cwhmisc package provides essentially the algorithm outlined by Dan. If you want answers outside your original data (extrapolation) then the following code at least won't give broken answers, though it is not necessarily any more "correct" for extrapolation than the approx solution is.

Re: [R] Empirical density estimation

2018-03-11 Thread Daniel Nordlund
On 3/11/2018 3:35 PM, Christofer Bogaso wrote: But for my reporting purpose, I need to generate a bell curve like plot based on empirical PDF, that also contains original points. Any idea would be helpful. Thanks, Christofer, something like the following may get you what you want: ## get

Re: [R] Empirical density estimation

2018-03-11 Thread Christofer Bogaso
But for my reporting purpose, I need to generate a bell curve like plot based on empirical PDF, that also contains original points. Any idea would be helpful. Thanks, On Mon, Mar 12, 2018 at 3:49 AM, Bert Gunter wrote: > You need to re-read ?density and perhaps think

Re: [R] Empirical density estimation

2018-03-11 Thread Jim Lemon
Hi Christofer, You may be looking for ecdf (stats) for a start, then working out a way to translate the cumulative density values into probability values. Jim On Mon, Mar 12, 2018 at 5:45 AM, Christofer Bogaso wrote: > Hi, > > Let say I have below vector of

Re: [R] Empirical density estimation

2018-03-11 Thread Bert Gunter
You need to re-read ?density and perhaps think again -- or do some study -- about how a (kernel) density estimate works. The points at which the estimate is calculated are *not* the values given, nor should they be! Cheers, Bert Bert Gunter "The trouble with having an open mind is that people