[R] Another newbie question: curve of normal distribution

Matej Cepl matej at ceplovi.cz
Tue Oct 15 19:17:27 CEST 2002


On Tue, Oct 15, 2002 at 08:33:43AM +0000, Renaud Lancelot wrote:
> Hi Matej,
> 
> heads  <- rbinom(n = 100, size = 40, p = .5) ### simulated data
> X <- quantile(heads, probs = seq(.001, .999, length = 1000))
> Y <- dnorm(X, mean = mean(heads), sd = sqrt(var(heads)))
> hist(heads, probability = T)
> lines(X, Y, col = "red")

Thanks, that's exactly what I need -- sorry for not explaining
better.

Matej

-- 
Matej Cepl, matej at ceplovi.cz, PGP ID# D96484AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
[W]hat country can preserve its liberties, if its rulers are not
warned from time to time that [the] people preserve the spirit of
resistance? Let them take arms...The tree of liberty must be
refreshed from time to time, with the blood of patriots and
tyrants.
    -- Thomas Jefferson, letter to Col. William S. Smith, 1787

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20021015/9c50a1cd/attachment.bin


More information about the R-help mailing list