survreg package:survival R Documentation _R_e_g_r_e_s_s_i_o_n _f_o_r _a _P_a_r_a_m_e_t_r_i_c _S_u_r_v_i_v_a_l _M_o_d_e_l _D_e_s_c_r_i_p_t_i_o_n: Fit a parametric survival regression model. These are location-scale models for an arbitrary transform of the time variable; the most common cases use a log transformation, leading to accelerated failure time models. _U_s_a_g_e: survreg(formula, data, weights, subset, na.action, dist="weibull", init=NULL, scale=0, control,parms=NULL,model=FALSE, x=FALSE, y=TRUE, robust=FALSE, score=FALSE, ...) _A_r_g_u_m_e_n_t_s: formula: a formula expression as for other regression models. The response is usually a survival object as returned by the 'Surv' function. See the documentation for 'Surv', 'lm' and 'formula' for details. data: a data frame in which to interpret the variables named in the 'formula', 'weights' or the 'subset' arguments. weights: optional vector of case weights subset: subset of the observations to be used in the fit na.action: a missing-data filter function, applied to the model.frame, after any 'subset' argument has been used. Default is 'options()\$na.action'. dist: assumed distribution for y variable. If the argument is a character string, then it is assumed to name an element from 'survreg.distributions'. These include '"weibull"', '"exponential"', '"gaussian"', '"logistic"','"lognormal"' and '"loglogistic"'. Otherwise, it is assumed to be a user defined list conforming to the format described in 'survreg.distributions'. parms: a list of fixed parameters. For the t-distribution 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 producted by 'survreg.control'. The default value is 'survreg.control()' 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' standard errors, based on independence of individuals if there is no 'cluster()' term in the formula, based on independence of clusters if there is. ...: other arguments which will be passed to 'survreg.control'. _V_a_l_u_e: an object of class 'survreg' is returned. _S_e_e _A_l_s_o: 'survreg.object', 'survreg.distributions', 'pspline', 'frailty', 'ridge' _E_x_a_m_p_l_e_s: # Fit an exponential model: these are all the same survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian, dist='weibull',scale=1) survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian, dist="exponential") # There are multiple ways to parameterize a Weibull distribution. The survreg # function imbeds it in a general location-scale familiy, 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 log-likelihood 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, but with left censored data. tobinfit <- survreg(Surv(durable, durable>0, type='left') ~ age + quant, data=tobin, dist='gaussian')