Re: [R] what "density" is plotting ?

2010-06-24 Thread Jeff Newmiller
?density

Or

http://en.m.wikipedia.org/wiki/Kernel_density_estimation?wasRedirected=true

"Ralf B"  wrote:

>The density function works empirically based on your data. It makes no
>assumption about an underlying distribution.
>
>Ralf
>
>On Thu, Jun 24, 2010 at 10:48 PM, Carrie Li  wrote:
>> Hello, Ralf,
>>
>> Sorry I was being clear.
>> I mean probability density function
>> like normal f(x)=(1/2*pi*sd )*exp()  something like that .
>> Sorry about the confusion
>>
>> Carrie
>>
>> On Thu, Jun 24, 2010 at 10:43 PM, Ralf B  wrote:
>>>
>>> Hi Carrie,
>>>
>>> the output is defined by you; density() only creates the function
>>> which you need to plot using the plot() function. When you call
>>> plot(density(x)) you get the output on the screen. You need to use
>>> pdf() if you want to create a pdf file, png() for creating a png file
>>> or postscript if you like ps; there are many others.
>>>
>>> Ralf
>>>
>>> On Thu, Jun 24, 2010 at 10:35 PM, Carrie Li 
>>> wrote:
>>> > Hi everyone,
>>> >
>>> > I am confused regarding the function "density".
>>> > suppose that there is a sample x of 100 data points, and
>>> > plot(density(x))
>>> > gives it's pdf ?
>>> > or it's more like histogram only ?
>>> >
>>> > thanks for any answering
>>> >
>>> > Carrie
>>> >
>>> >        [[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.
>>> >
>>
>>
>
>__
>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.

---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
---
Sent from my phone. Please excuse my brevity.

__
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.


Re: [R] what "density" is plotting ?

2010-06-24 Thread Ralf B
The density function works empirically based on your data. It makes no
assumption about an underlying distribution.

Ralf

On Thu, Jun 24, 2010 at 10:48 PM, Carrie Li  wrote:
> Hello, Ralf,
>
> Sorry I was being clear.
> I mean probability density function
> like normal f(x)=(1/2*pi*sd )*exp()  something like that .
> Sorry about the confusion
>
> Carrie
>
> On Thu, Jun 24, 2010 at 10:43 PM, Ralf B  wrote:
>>
>> Hi Carrie,
>>
>> the output is defined by you; density() only creates the function
>> which you need to plot using the plot() function. When you call
>> plot(density(x)) you get the output on the screen. You need to use
>> pdf() if you want to create a pdf file, png() for creating a png file
>> or postscript if you like ps; there are many others.
>>
>> Ralf
>>
>> On Thu, Jun 24, 2010 at 10:35 PM, Carrie Li 
>> wrote:
>> > Hi everyone,
>> >
>> > I am confused regarding the function "density".
>> > suppose that there is a sample x of 100 data points, and
>> > plot(density(x))
>> > gives it's pdf ?
>> > or it's more like histogram only ?
>> >
>> > thanks for any answering
>> >
>> > Carrie
>> >
>> >        [[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.
>> >
>
>

__
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.


Re: [R] what "density" is plotting ?

2010-06-24 Thread Carrie Li
Hello, Ralf,

Sorry I was being clear.
I mean probability density function
like normal f(x)=(1/2*pi*sd )*exp()  something like that .
Sorry about the confusion

Carrie

On Thu, Jun 24, 2010 at 10:43 PM, Ralf B  wrote:

> Hi Carrie,
>
> the output is defined by you; density() only creates the function
> which you need to plot using the plot() function. When you call
> plot(density(x)) you get the output on the screen. You need to use
> pdf() if you want to create a pdf file, png() for creating a png file
> or postscript if you like ps; there are many others.
>
> Ralf
>
> On Thu, Jun 24, 2010 at 10:35 PM, Carrie Li 
> wrote:
> > Hi everyone,
> >
> > I am confused regarding the function "density".
> > suppose that there is a sample x of 100 data points, and plot(density(x))
> > gives it's pdf ?
> > or it's more like histogram only ?
> >
> > thanks for any answering
> >
> > Carrie
> >
> >[[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.
> >
>

[[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.


Re: [R] what "density" is plotting ?

2010-06-24 Thread Ralf B
Hi Carrie,

the output is defined by you; density() only creates the function
which you need to plot using the plot() function. When you call
plot(density(x)) you get the output on the screen. You need to use
pdf() if you want to create a pdf file, png() for creating a png file
or postscript if you like ps; there are many others.

Ralf

On Thu, Jun 24, 2010 at 10:35 PM, Carrie Li  wrote:
> Hi everyone,
>
> I am confused regarding the function "density".
> suppose that there is a sample x of 100 data points, and plot(density(x))
> gives it's pdf ?
> or it's more like histogram only ?
>
> thanks for any answering
>
> Carrie
>
>        [[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.
>

__
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.