[R] Density estimation

From: Gunther Jansen <gunther.jansen_at_gmail.com>
Date: Wed, 23 Apr 2008 13:58:49 +0300


I am analysing a dataset containing genetic distances within and between species. I want to show a overlap of the distributions of the intra- and interspecific values; on a second graph I use a cut-off value to determine these boundaries. As the dataset contains >30 000 values, I would like to do this with a simple line rather than superimposed histograms. Hence, density plots. With the standard settings of plot(density(x)), I receive the desirable result, except that the function extends slightly in negative x values (which is impossible, distance values are always positive). Furthermore, in the second figure I supplied the cut-off value a priori, so overlap between the two classes is zero by definition. Is there a way to visualise this information in another way, or to readjust the density parameters so intraspecific values below zero have zero probability in the first case, and there is no overlap in the second case?



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 Wed 23 Apr 2008 - 11:11:43 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 Wed 23 Apr 2008 - 18:30:31 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