There is not a mechanism to get the internal bits of survreg. This is unlike coxph, where I wrote the coxph.detail routine to give exactly what you ask (for debugging purposes). It has turned out to
The simplest way that I know to get an estimate of the hazard is to use smoothing splines. fit <- survfit(Surv(time, status) ~ sex, data=lung) temp1 <- smooth.spline(fit[1]$time, 1-fit[1]$surv, df=5)
This is one area where a printed (paper) manual can't be beat. However, one has not been produced for S-Plus in a long time. Several years ago I sat down with said manual in my favorite comfortable r
For recoding a set of variables: I'll assume that all of these variables reside in a particular data frame named "mydata", and that you want to change the variable levels: for (i in c('a1', 'a2', 'a3
Katherine Hoggatt asked about the ties option in SAS vs Splus, and why they look different: If data is discrete, i.e., the time scale has only a few distinct values, then the appropriate option for t
You forgot the distribution: Coefficients: (Intercept) -0.01141028 Scale= 3.02965 (Intercept) 1.510897 The default fit is a Wiebull distribution. Terry Therneau (author of survreg)
A simple way to do what you ask is found in almost all the modeling functions (lm, coxph, etc). At the top of the function, before manipulating any arguments, you will find the line call <- match.cal
2. How to fit a weibull? Although survReg and censorreg were designed to allow for censored data, they work just fine with ordinary Weibull data. fit <- survReg(Surv(y) ~ x1 + x2 + ...., data=mydata,
The details about case weights and offset terms, in both SAS and S, are discussed in section 7.3 of the book by Therneau and Grambsch. It covers 7 pages, so is a bit much to try and summarize in an e
... why do Splus and Stata differ? The Wiebull model can either be expressed as a proportional hazards or an accelerated failure time model. These are just different parameterizations, with no partic
The survreg function uses location-scale parameterization, which is one of about 4 ways to write down the Wiebull distribution. The best reference on the parameters is Kalbfleisch and Prentice, The S
There are dozens of definitions for an R-square for a Cox model. I really liked the following paper Korn, Edward L. , and Simon, Richard (1990), ``Measures of explained variation for survival data'',
The coxph function is failing because there is no good solution to your As set up, at any death time the observation that dies is that one with the smallest x value. You can replicate your results wi
(survreg in R, survReg in Splus). The survreg routine was designed for the harder case of censored y's with "Surv(y, status)" on the left, but it accomodates ordinary data as well. Terry Therneau