Skip to content
Back to formatted view

Raw Message

Message-ID: <CAF78DZ3uXdXsceejpYVZe2N_NerTFudpM0SGZewLkStcVumEFA@mail.gmail.com>
Date: 2012-10-08T13:40:44Z
From: Francesco
Subject: weighted cumulative distribution with ggplot2

Dear all,

I am trying to draw a weighted cumulative distribution (as defined
here http://rss.acs.unt.edu/Rdoc/library/spatstat/html/ewcdf.html)
with ggplot2

however the syntax

temp<-qplot(X,weight=weight,data=data,stat = "ecdf", geom =
"step",colour=factor(year))

seems not to produce exactly the right figure (the values seems higher
at some points)... I am wrong in the weight definition?

The data is like the following

X     Weight Year
0      2         2001
0      1         2001
1      5         2001
2      1         2001
2      3         2001
2      2         2002
3.. etc

Any ideas ?
Many thanks in advance