weibreg(formula = formula(data), data = parent.frame(),
na.action = getOption("na.action"), init, shape = 0,
control = list(eps = 1e-04, maxiter = 10, trace = FALSE),
singular.ok = TRUE, model = FALSE, x = FALSE, y = TRUE, center = TRUE)
options()$na.action
.eps
(convergence
criterion), maxiter
(maximum number of iterations), and
silent
(logical, controlling amount of output). You can
change any component without mention the other(s).c("weibreg", "coxreg", "coxph")
with componentsNULL
if not).print.weibreg
doesn't work if
threeway or higher order interactions are present. Use
print.coxph
in that case.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
.
coxreg
and coxph
, but different
from the one used by survreg
.
The model is
$$h(t; a, b, \beta, z) = (a/b) (t/b)^{a-1}\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 p-values 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)$
coxreg
, mlreg
,
print.weibreg
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
Run the code above in your browser using DataLab