> survreg(Surv(times,censor),dist='weibull') Error in x$terms : $ operator is invalid for atomic vectors
You need a right-hand side for the formula survreg(Surv(times, censor) ~1, dist='weibull') In your code the first argument was not recognized as a "formula", and the program subsequently got very confused. The error message was not very helpful, unfortunately. FYI: from an updated help page for survreg.distributions > y<-rweibull(1000, shape=2, scale=5) > survreg(Surv(y)~1, dist="weibull") Coefficients: (Intercept) 1.607516 Scale= 0.5187037 Survreg parameters are scale=1/shape, intercept=log(scale). This is because the Weibull has been imbedded in a general location-scale framework. Terry Therneau ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.