Re: [R] two densities with same stepsize

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Tue, 5 Feb 2008 09:32:14 -0700

Duncan told you how to do this using density, another option is to use the logspline package for a different way to estimate densities. With this approach you can use the dlogspline and plogspline functions to compare your density estimates.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Antje
> Sent: Tuesday, February 05, 2008 1:22 AM
> To: r-help_at_stat.math.ethz.ch
> Subject: [R] two densities with same stepsize
>
> Hi there,
>
> I have two series of data. plotting the density function of
> both gives me an idea about the difference of the data. But I
> would like to quantify the difference I see.
>
> a <- rnorm(100)
> b <- rnorm(100)
>
> da <- density(a)
> db <- density(b)
>
> The problem is that da$x and db$x are different and so I have
> difficulties to compare them... Is there any way to force the
> density funtion to produce the values for the same x-steps?
> Or is there any other statistical approach I should use for
> comparing two density functions? I need to quantify how much
> the data-series differ (density function is rather complex in
> my case with skew and several maximas, so not easily to
> describe as a mathematical function.
> Sorry, I'm not that deep into statistics. Any comments /
> keywords on this is welcome...
>
> Antje
>
> ______________________________________________
> 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 Tue 05 Feb 2008 - 16:45:25 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 Tue 05 Feb 2008 - 17:30:10 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