Proportional hazards model with parametric baseline hazard(s). Allows for stratification with different scale and shape in each stratum, and left truncated and right censored data.
phreg(
formula = formula(data),
data = parent.frame(),
na.action = getOption("na.action"),
dist = "weibull",
cuts = NULL,
init,
shape = 0,
param = c("canonical", "rate"),
control = list(eps = 1e-08, maxiter = 20, trace = FALSE),
singular.ok = TRUE,
model = FALSE,
x = FALSE,
y = TRUE
)
A list of class c("phreg", "coxreg")
with components
Fitted parameter estimates.
Cut points for
the "pch" distribution. NULL
otherwise.
The estimated
constant levels in the case of the "pch" distribution. NULL
otherwise.
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, except those columns corresponding to a factor level. Otherwise all zero.
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.
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.
a data.frame in which to interpret the variables named in the formula.
a missing-data filter function, applied to the model.frame,
after any subset argument has been used. Default is
options()$na.action
.
Which distribution? Default is "weibull", with the alternatives
"ev" (Extreme value), "gompertz", "pch" (piecewise constant hazards
function), "loglogistic" and "lognormal". A special case like the
exponential
can be obtained by choosing "weibull" in combination with
shape = 1
, or "pch" without cuts
.
Only used with dist = "pch"
. Specifies the points in time
where the hazard function jumps. If omitted, an exponential model is fitted.
vector of initial values of the iteration. Default initial value is zero for all variables.
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. Only relevant for the Weibull and Extreme Value distributions.
Applies only to the Gompertz distribution: "canonical" is
defined in the description of the Gompertz
distribution;
"rate" transforms scale
to 1/log(scale), giving the same
parametrization as in Stata and SAS. The latter thus allows for a negative
rate, or a "cure" (Gompertz) model. The default is "canonical"; if this
results in extremely large scale and/or shape estimates, consider trying
"rate".
a list with components 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).
Not used.
Not used.
Return the design matrix in the model object?
Return the response in the model object?
The lognormal and loglogistic distributions are included on an experimental basis for the moment. Use with care, results may be unreliable!
The gompertz distribution has an exponentially increasing hazard function
under the canonical parametrization. This may cause instability in the
convergence of the fitting algorithm in the case of near-exponential data.
It may be resolved by using param = "rate"
.
Göran Broström
The parameterization is the same as in coxreg
and
coxph
, but different from the one used by
survreg
(which is not a proportional hazards
modelling function). The model is $$S(t; a, b, \beta, z) =
S_0((t/b)^a)^{\exp((z-mean(z))\beta)}$$ where S0 is some standardized survivor
function.
coxreg
, check.dist
,
link{aftreg}
.
data(mort)
fit <- phreg(Surv(enter, exit, event) ~ ses, data = mort)
fit
plot(fit)
fit.cr <- coxreg(Surv(enter, exit, event) ~ ses, data = mort)
check.dist(fit.cr, fit)
Run the code above in your browser using DataLab