You need to take into account the bin width as well (hence the extra multiple you asked about), but it is simpler to just include prob=TRUE in the hist call, then you do not need to do any adjustment on the y-values of the reference distribution.
-- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of "Sibylle Stöckli" > Sent: Thursday, September 23, 2010 1:43 AM > To: r-help@r-project.org > Subject: [R] dnorm > > Dear R-users > > Idea: > Plot a dnorm line using specific mean/sd to complete a histogram > (skewed). xs:range of y-values, ys: dnorm function > > Problem: > I expected to multiply the ys function with the sample size (n=250- > 300). I was wondering about a factor between 12'000 and 30'000 to match > the size of the dnorm line with the specific histogram. > > Thanks > Sibylle > > hist(Biotree[Ld,]$Height2008, main="Larix decidua", ylim=c(0,50), > xlab="Tree Height 2008 (cm)",col="aquamarine", font.main=3, > cex.axis=0.8) > xs<-0:650 > ys<-dnorm(xs, mean=397.8, sd=97.6) > lines(xs,ys*12000) > > -- > GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 > Euro/mtl.!* > > ______________________________________________ > 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. ______________________________________________ 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.