> # Weibull regression > mdata <-read.table("strike.csv", header=T, sep=",") > y <-mdata[,1] > x <-mdata[,2] > status <-mdata[,3] > mydata <-data.frame(y,x,status) > library(survival) > # AFT model (accelerated failure time model) > survreg(Surv(y,status)~x, dist="weibull") Call: survreg(formula = Surv(y, status) ~ x, dist = "weibull") Coefficients: (Intercept) x 3.9663834 -0.6947956 Scale= 0.9675753 Loglik(model)= -398.3 Loglik(intercept only)= -398.4 Chisq= 0.09 on 1 degrees of freedom, p= 0.759 n= 80 > p = 1/0.9675753 > beta1 = -(-0.6947956)/0.9675753 > beta0 = -(3.9663834)/0.9675753 > cbind(p, beta0, beta1) p beta0 beta1 [1,] 1.033511 -4.099302 0.7180791 > summary(survreg(Surv(y,status)~x, dist="weibull")) Call: survreg(formula = Surv(y, status) ~ x, dist = "weibull") Value Std. Error z p (Intercept) 3.9664 0.1448 27.40 <2e-16 x -0.6948 2.2856 -0.30 0.76 Log(scale) -0.0330 0.0896 -0.37 0.71 Scale= 0.968 Weibull distribution Loglik(model)= -398.3 Loglik(intercept only)= -398.4 Chisq= 0.09 on 1 degrees of freedom, p= 0.76 Number of Newton-Raphson Iterations: 7