Try
x<-rowMeans(matrix((rbinom(1000,4,.45)-4*.45)/sqrt(.45*.55/4),ncol=10))
hist(x,freq=F,ylim=c(0,.5)) ### The key is the freq=F option.
curve(dnorm(x),add=T) ### You can use curve to plot a function
lines(density(x)) ### Or density for a kernel density estimate.
-tgs
On Thu, May 6, 2010
Hi,
I don't quite understand what you want. But perhaps, you would like to
try this
hist(datobs)
lines(density(datobs))
and get some ideas
Best,
Ruihong
On 05/07/2010 02:42 AM, Roslina Zakaria wrote:
> Hi r-users,
>
> I would like to overlap a smooth line on the histogram. I tried using s
Hi r-users,
I would like to overlap a smooth line on the histogram. I tried using spline
but it does not work.
sq <- seq(0,900,by=50)
sq.50 <- as.character(sq)
datobs <- sum_pos
## first, plot histogram
histo <- hist(datobs,breaks=sq,freq=F)
## extract counts from histogram and calculate
3 matches
Mail list logo