Proportional hazards model with baseline hazard(s) from the Weibull family of distributions. Allows for stratification with different scale and shape in each stratum, and left truncated and right censored data.
weibreg( formula = formula(data), data = parent.frame(), na.action = getOption("na.action"), init, shape = 0, control = list(eps = 1e04, maxiter = 10, trace = FALSE), singular.ok = TRUE, model = FALSE, x = FALSE, y = TRUE, center = TRUE )
formula  a formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function. 

data  a data.frame in which to interpret the variables named in the formula. 
na.action  a missingdata filter function, applied to the model.frame,
after any subset argument has been used. Default is

init  vector of initial values of the iteration. Default initial value is zero for all variables. 
shape  If positive, the shape parameter is fixed at that value (in each stratum). If zero or negative, the shape parameter is estimated. If more than one stratum is present in data, each stratum gets its own estimate. 
control  a list with components 
singular.ok  Not used. 
model  Not used. 
x  Return the design matrix in the model object? 
y  Return the response in the model object? 
center  Deprecated, and not used. Will be removed in the future. 
A list of class c("weibreg", "coxreg")
with components
Fitted parameter estimates.
Covariance matrix of the estimates.
Vector of length two; first component is the value at the initial parameter values, the second componet is the maximized value.
The score test statistic (at the initial value).
The estimated linear predictors.
Means of the columns of the design matrix.
Weighted (against exposure time) means of covariates; weighted relative frequencies of levels of factors.
Number of spells in indata (possibly after removal of cases with NA's).
Number of events in data.
Used by extractor functions.
Used by extractor functions.
The Wald test statistic (at the initial value).
The Surv vector.
Logical vector indicating the covariates that are factors.
The covariates.
Total Time at Risk.
List of levels of factors.
The calling formula.
The call.
The method.
Did the optimization converge?
Did the optimization fail? (Is NULL
if not).
TRUE if shape was fixed in the estimation.
The parameterization is the same as in coxreg
and
coxph
, but different from the one used by
survreg
. The model is $$h(t; a, b, \beta, z) =
(a/b) (t/b)^{a1} exp(z\beta)$$ This is in correspondence with Weibull
. To
compare regression coefficients with those from survreg
you need to
divide by estimated shape (\(\hat{a}\)) and change sign. The pvalues
and test statistics are however the same, with one exception; the score test
is done at maximized scale and shape in weibreg
.
This model is a Weibull distribution with shape parameter \(a\) and scale parameter \(b \exp(z\beta / a)\)
This function is not maintained, and may behave in unpredictable ways.
Use phreg
with dist = "weibull"
(the default) instead!
Will soon be declared deprecated.
The print method print.weibreg
doesn't work
if threeway or higher order interactions are present.
Note further that covariates are internally centered, if center =
TRUE
, by this function, and this is not corrected for in the output. This
affects the estimate of \(\log(scale)\), but nothing else. If
you don't like this, set center = FALSE
.
Göran Broström
dat < data.frame(time = c(4, 3, 1, 1, 2, 2, 3), status = c(1, 1, 1, 0, 1, 1, 0), x = c(0, 2, 1, 1, 1, 0, 0), sex = c(0, 0, 0, 0, 1, 1, 1)) weibreg( Surv(time, status) ~ x + strata(sex), data = dat) #stratified model#> Call: #> weibreg(formula = Surv(time, status) ~ x + strata(sex), data = dat) #> #> Covariate Mean Coef Exp(Coef) se(Coef) Wald p #> x 0.625 0.590 1.804 0.593 0.320 #> #> log(scale):1 1.324 3.758 0.312 0.000 #> log(shape):1 1.040 2.829 0.496 0.036 #> log(scale):2 1.038 2.823 0.190 0.000 #> log(shape):2 1.359 3.893 0.570 0.017 #> #> Events #> Total time at risk 16 #> Max. log. likelihood 7.5616 #> LR test statistic 0.99 #> Degrees of freedom 1 #> Overall pvalue 0.318548