0

I want to plot cumulative distributions curve for Weibull distribution over empirical cumulative distribution curve.

I have tried with this several times but it does not serve the way I want. Here is the command:

x<-(SIZEDIST$AVG.µm.)
x
plot(x,pweibull(x,shape=1.120662,scale=18.496778),type="l",col=4)
plot(ecdf(x),add=TRUE)
Andre Silva
  • 4,782
  • 9
  • 52
  • 65
user2968058
  • 25
  • 2
  • 11

2 Answers2

0

Use lines instead of plot

plot(x,pweibull(x,shape=1.120662,scale=18.496778),type="l",col=4)
lines(ecdf(x),col='red')
Maciej
  • 3,255
  • 1
  • 28
  • 43
  • hi. thanks for your comment. but while trying to execute the command it appears something unusual which I don't want. well the graphs are combined but the weibull cumulative curve appears as combination of plenty of polygons which is pretty unexpected. can u please update me. and also I'd like to know how can I change the appearance ecdf curve because it appears as lines studded with the points, whereas Ii want only the lines. – user2968058 Mar 16 '14 at 16:36
  • Could you paste reproductive example? – Maciej Mar 16 '14 at 17:51
0

Like this?

set.seed(1)  # for reproducibility
# 1000 random samples from the Weibull dist
X <-rweibull(1000,shape=1.120662,scale=18.496778)
# z covers the range in X
z <- seq(min(x),max(x),length=100)
plot(z,pweibull(z,shape=1.120662,scale=18.496778),type="l",col=4, ylab="CDF")
plot(ecdf(x),add=TRUE)
jlhoward
  • 58,004
  • 7
  • 97
  • 140