I need help,
the codes below estimates the weibull parameters with complete failure, my
question is how do i change the state to include
some censoring (may be right, type-I or type-II) to generate and estimate the
parameters.
thank you
x=rweibull(10,2,2)
library(survival)
d<-data.frame(ob=c(x),state=1)
s <- Surv(d$ob,d$state)
sr <- survreg(s~1,dist="weibull")
print(paste("beta =",1/sr$scale))
print(paste("eta =",exp(sr$coefficients[1])))
or
library(MASS)
set.seed(123)
m <- replicate(1000, coef(fitdistr(rweibull(50, 0.8, 2),
"weibull")))
summary(t(m))
[[alternative HTML version deleted]]