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

From: Ralf B <ralf.bierig_at_gmail.com>
Date: Thu, 24 Jun 2010 23:20:23 -0400

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 <carrieandstat_at_gmail.com> wrote:
> Hello, Ralf,
>
> Sorry I was being clear.
> I mean probability density function
> like normal f(x)=(1/2*pi*sd )*exp(xxxx)  something like that .
> Sorry about the confusion
>
> Carrie
>
> On Thu, Jun 24, 2010 at 10:43 PM, Ralf B <ralf.bierig_at_gmail.com> 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 <carrieandstat_at_gmail.com>
>> 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_at_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_at_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. Received on Fri 25 Jun 2010 - 03:26:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jun 2010 - 05:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive