[R] Help with normal distributions
dimitris.rizopoulos at med.kuleuven.ac.be
Mon Oct 4 12:38:15 CEST 2004
regarding your first question try the following,
#if `x' is your data vector, then
y <- seq(min(x), max(x), length=200)
lines(y, dnorm(y, mean(x), sd(x)))
regarding your second question, you'd probably want to fit a mixture
model -> look at package `mclust'.
I hope it helps.
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
----- Original Message -----
From: "michael watson (IAH-C)" <michael.watson at bbsrc.ac.uk>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, October 04, 2004 12:04 PM
Subject: [R] Help with normal distributions
> I have two questions, the first perhaps dumber than the second.
> Firstly, I have a data set, and when I plot a histogram it looks
> like a
> normal distribution. So I want to overlay a bell-shaped normal
> distribution on top of it, to demonstrate how similar it is to the
> normal distribution. I have read the help on dnorm(), rnorm(),
> etc but still can't figure out how to plot a normal distribution.
> code would be appreciated....
> Secondly, and perhaps more difficult, is a second data set. This,
> plotted as a histogram, has two clear peaks, perhaps even three, all
> which look as though they are normally distributed. So the theory
> that my data set is actually made up of two, possibly three,
> sub-sets of data which are normally distributed, but with different
> means and standard deviations. So 1) how do I test for this? And 2)
> can I estimate the parameters (mean and SD) for the underlying
> Thanks in advance for your help
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help