This is a reply to Luke Spadavecchia's question about hist densities.

 

If you want to construct a histogram where the bar heights are the
percentage of observations in the intervals you can use this code:

 

x<-rnorm(n=5000,mean=1.5,sd=0.25)

h<-hist(x)

h$density<-h$counts/sum(h$counts)

plot(h,freq=F,ylab="Percentage")

 

Sarah Hardy

Sarah.hardy@maine.edu

 

 


	[[alternative HTML version deleted]]

