weibreg {micsr} | R Documentation |
Weibull regression model for duration data
Description
The Weibull model is the most popular model for duration data. This function enables the estimation of this model with two alternative (but equivalent) parametrization: the Accelerate Failure Time and the Proportional Hazard. Moreover heterogeneity can be introduced, which leads to the Gamma-Weibull model
Usage
weibreg(
formula,
data,
weights,
subset,
na.action,
offset,
contrasts = NULL,
model = c("aft", "ph"),
opt = c("bfgs", "newton", "nr"),
start = NULL,
maxit = 100,
robust = TRUE,
trace = 0,
mixing = FALSE,
check_gradient = FALSE,
...
)
gres(x)
## S3 method for class 'weibreg'
scoretest(object, ..., vcov = NULL)
Arguments
formula |
a symbolic description of the model |
data |
a data frame |
subset , weights , na.action , offset , contrasts |
see |
model |
one of |
opt |
the optimization method |
start |
a vector of starting values |
maxit |
maximum number of iterations |
robust |
a boolean if |
trace |
an integer |
mixing |
if |
check_gradient |
if |
... |
further arguments |
x , object |
a |
vcov |
the covariance matrix estimator to use for the score test |
Value
an object of class c("weibreg", "micsr")
, see
micsr::micsr
for further details.
Examples
library(survival)
wz <- weibreg(Surv(duration, censored == "no") ~ gender + age + log(wage + 1),
unemp_duration, mixing = TRUE, model = "ph")