On 23-Mar-07 11:06:49, Plessen, Christian von wrote:
>
> I am looking for a way to produce a "distribution graph" as in the
> example:
>
> (http://cecsweb.dartmouth.edu/release1.1/datatools/dgraph.php?year=2003&
> geotype=STD_HRR&event=A01_DIS&eventtype=UTIL
>
> Anybody who can help?
>
> Christian von Plessen
> Department of Pulmonary Medicine
> Haukeland university hospital
> Bergen
> Norway
The following (which anyway needs refinement, and can very
probably be done better) provides a basis (illustrated using
a sample from a log-normal distribution):
X<-exp(rnorm(200,sd=0.25)+2)/5
H<-hist(X,breaks=20)
C<-H$counts
Y<-H$mids
C1<-C/2
C0<-(-C1[1]-1/2):(C[1]-1/2); n0<-length(C0)
plot(C0,rep(Y[1],n0),xlim=c(-max(C)/2,max(C)/2),ylim=c(min(Y),max(Y)))
for(i in (2:length(Y))){
C0<-(-C1[i]-1/2):(C1[i]-1/2); n0<-length(C0)
points(C0,rep(Y[i],n0))
}
Hoping this helps!
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
Fax-to-email: +44 (0)870 094 0861
Date: 23-Mar-07 Time: 13:04:51
------------------------------ XFMail ------------------------------
______________________________________________
[email protected] 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.