View Full Version : fit weibull censoring easy question matlab


leo nidas
11-16-2008, 05:31 AM
Hi there,

Suppose that you have a study in which 150 individuals participate. The times of their death is recorded (let Weibull(2,3),matlab parameterization of the Weibull), and every indinidual surviving for C=2 years is being censored at 2 years (end of study). There is no random censoring. I am interested in the estimation of the parameters of the Weibull. So I wrote the following code in Matlab. I estimate the parameters with two ways

1. by discarding all censored data ( ahat_cc, bhat_cc).
2. by using all the data (ahat, bhat).

Now here is my question. Method 2 shouldn't always (i.e. for any value of C) give better results?? Well my code sais different so I guess somewhere there is a mistake. I've checked on it many times and I cannot figure out what is going wrong...

Someone please help...... (I am right that method 2 should always work better, aren't I)?? Ask me if I was not clear about something......

n=150;

for j=1:1

x=wblrnd(2,3,1,n);
C=2;
status=(x>C);
xcen=min(x,C);
pars=wblfit(xcen,status);
ahat(j)=pars(1);
bhat(j)=pars(2);
pars_cc=wblfit(xcen(find(status==0)),status(status (find(status==0))));
ahat_cc(j)=pars_cc(1);
bhat_cc(j)=pars_cc(2);

end