Description Usage Arguments Details Value References See Also Examples
Fit a parametric survival regression model. These are locationscale models for an arbitrary transform of the time variable; the most common cases use a log transformation, leading to accelerated failure time models.
1 2 3 4 
formula 
a formula expression as for other regression models.
The response is usually a survival object as returned by the 
data 
a data frame in which to interpret the variables named in
the 
weights 
optional vector of case weights 
subset 
subset of the observations to be used in the fit 
na.action 
a missingdata filter function, applied to the model.frame, after any

dist 
assumed distribution for y variable.
If the argument is a character string, then it is assumed to name an
element from 
parms 
a list of fixed parameters. For the tdistribution for instance this is the degrees of freedom; most of the distributions have no parameters. 
init 
optional vector of initial values for the parameters. 
scale 
optional fixed value for the scale. If set to <=0 then the scale is estimated. 
control 
a list of control values, in the format produced by

model,x,y 
flags to control what is returned. If any of these is true, then the model frame, the model matrix, and/or the vector of response times will be returned as components of the final result, with the same names as the flag arguments. 
score 
return the score vector. (This is expected to be zero upon successful convergence.) 
robust 
Use robust sandwich error instead of the asymptotic
formula. Defaults to TRUE if there is a 
cluster 
Optional variable that identifies groups of subjects,
used in computing the robust variance. Like 
... 
other arguments which will be passed to 
All the distributions are cast into a locationscale framework, based on chapter 2.2 of Kalbfleisch and Prentice. The resulting parameterization of the distributions is sometimes (e.g. gaussian) identical to the usual form found in statistics textbooks, but other times (e.g. Weibull) it is not. See the book for detailed formulas.
an object of class survreg
is returned.
Kalbfleisch, J. D. and Prentice, R. L., The statistical analysis of failure time data, Wiley, 2002.
survreg.object
, survreg.distributions
,
pspline
, frailty
, ridge
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  # Fit an exponential model: the two fits are the same
survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian, dist='weibull',
scale=1)
survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian,
dist="exponential")
#
# A model with different baseline survival shapes for two groups, i.e.,
# two different scale parameters
survreg(Surv(time, status) ~ ph.ecog + age + strata(sex), lung)
# There are multiple ways to parameterize a Weibull distribution. The survreg
# function embeds it in a general locationscale family, which is a
# different parameterization than the rweibull function, and often leads
# to confusion.
# survreg's scale = 1/(rweibull shape)
# survreg's intercept = log(rweibull scale)
# For the loglikelihood all parameterizations lead to the same value.
y < rweibull(1000, shape=2, scale=5)
survreg(Surv(y)~1, dist="weibull")
# Economists fit a model called `tobit regression', which is a standard
# linear regression with Gaussian errors, and left censored data.
tobinfit < survreg(Surv(durable, durable>0, type='left') ~ age + quant,
data=tobin, dist='gaussian')

Call:
survreg(formula = Surv(futime, fustat) ~ ecog.ps + rx, data = ovarian,
dist = "weibull", scale = 1)
Coefficients:
(Intercept) ecog.ps rx
6.9618376 0.4331347 0.5815027
Scale fixed at 1
Loglik(model)= 97.2 Loglik(intercept only)= 98
Chisq= 1.67 on 2 degrees of freedom, p= 0.43
n= 26
Call:
survreg(formula = Surv(futime, fustat) ~ ecog.ps + rx, data = ovarian,
dist = "exponential")
Coefficients:
(Intercept) ecog.ps rx
6.9618376 0.4331347 0.5815027
Scale fixed at 1
Loglik(model)= 97.2 Loglik(intercept only)= 98
Chisq= 1.67 on 2 degrees of freedom, p= 0.43
n= 26
Call:
survreg(formula = Surv(time, status) ~ ph.ecog + age + strata(sex),
data = lung)
Coefficients:
(Intercept) ph.ecog age
6.73234505 0.32443043 0.00580889
Scale:
sex=1 sex=2
0.7834211 0.6547830
Loglik(model)= 1137.3 Loglik(intercept only)= 1146.2
Chisq= 17.8 on 2 degrees of freedom, p= 0.00014
n=227 (1 observation deleted due to missingness)
Call:
survreg(formula = Surv(y) ~ 1, dist = "weibull")
Coefficients:
(Intercept)
1.591229
Scale= 0.5238793
Loglik(model)= 2217.9 Loglik(intercept only)= 2217.9
n= 1000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.