Re: [R] Density estimation and plots

From: Jim Silverton <jim.silverton_at_gmail.com>
Date: Wed, 13 Apr 2011 23:52:38 -0400


I have two columns of data, one is a subset of the other. All the data lie beteen 0 and 1 inclusive. I want to fit both densities on the same graph. I would also like the ability to extract the fitted values of both smoothed density (using the best method of course).

For example, if
h = c( runif(1000, 0, 1), rbeta(500, 3,9)) and k = rbeta(500,3,9)
then how do I get both density plots on the same diagram and if I want the actual y values (fitted values) for each of the x values in h and k, how do I get these?

-- 
Thanks,
Jim.

	[[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.
Received on Thu 14 Apr 2011 - 03:55:57 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 Thu 14 Apr 2011 - 05:00:30 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