I have a question. I have a data set (about 100,000 observations). How would I get the distribution curve graph? This is like, if I use hist(x, freq="TRUE", breaks=1000) to get the histogram, now the question is, I don't need the histogram itself, I just need the curve that connects the top of each histogram bin. Thank you very much! -- View this message in context: http://www.nabble.com/how-to-get-the-distribution-curve-from-a-data-set--tp17678286p17678286.html Sent from the R help mailing list archive at Nabble.com.
Henrique Dallazuanna
2008-Jun-05 20:30 UTC
[R] how to get the distribution curve from a data set?
See ?density On Thu, Jun 5, 2008 at 4:56 PM, rlearner309 <unixunix99@gmail.com> wrote:> > I have a question. > I have a data set (about 100,000 observations). How would I get the > distribution curve graph? This is like, if I use hist(x, freq="TRUE", > breaks=1000) to get the histogram, now the question is, I don't need the > histogram itself, I just need the curve that connects the top of each > histogram bin. > Thank you very much! > > -- > View this message in context: > http://www.nabble.com/how-to-get-the-distribution-curve-from-a-data-set--tp17678286p17678286.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
Daniel Folkinshteyn
2008-Jun-05 20:32 UTC
[R] how to get the distribution curve from a data set?
would a density plot do? try plot(density(x)) if you are specifically after the histogram tops rather than a density estimate, then get the hist object with plot=F, then look at the counts attribute: histobj = hist(x, freq="TRUE", breaks=1000, plot=F) plot(histobj$counts) hope this helps. on 06/05/2008 03:56 PM rlearner309 said the following:> I have a question. > I have a data set (about 100,000 observations). How would I get the > distribution curve graph? This is like, if I use hist(x, freq="TRUE", > breaks=1000) to get the histogram, now the question is, I don't need the > histogram itself, I just need the curve that connects the top of each > histogram bin. > Thank you very much! >