[R] R-help; Censoring

Christopher Kelvin chris_kelvin2001 at yahoo.com
Wed Apr 11 05:48:21 CEST 2012


Hello,
I wish to censor 10% of my sample units of 50 from a Weibull distribution. Below is the code for it.
I will need to know whether what i have done is correct and if not, can i have any suggestion to improve it?
Thank you

 p=2;b=120
n=50
r=45

t<-rweibull(r,shape=p,scale=b)
meantrue<-gamma(1+(1/p))*b
meantrue

cen<- runif(n-r,min=0,max=meantrue)
cen


Chris Guure
Researcher,
Institute for Mathematical Research
UPM



More information about the R-help mailing list