Learn R Programming

eha (version 1.2-18)

phreg: Parametric Proportional Hazards Regression

Description

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.

Usage

phreg(formula = formula(data), data = parent.frame(),
na.action = getOption("na.action"), dist = "weibull", init, shape = 0,
control = list(eps = 1e-08, maxiter = 20, trace = FALSE),
singular.ok = TRUE, model = FALSE, x = FALSE, y = TRUE, center = FALSE)

Arguments

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 missing-data filter function, applied to the model.frame, after any subset argument has been used. Default is options()$na.action.
dist
Which distribution? Default is "weibull", with the alternatives "loglogistic" and "lognormal". A special case like the exponential can be obtained by choosing "weibull" in combination with shape = 1.
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 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).
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
Should results from centering the covariates be reported? Default is FALSE.

Value

  • A list of class c("phreg", "coxreg", "coxph") with components
  • coefficientsFitted parameter estimates.
  • varCovariance matrix of the estimates.
  • loglikVector of length two; first component is the value at the initial parameter values, the second componet is the maximized value.
  • scoreThe score test statistic (at the initial value).
  • linear.predictorsThe estimated linear predictors.
  • meansMeans of the columns of the design matrix.
  • w.meansWeighted (against exposure time) means of covariates; weighted relative frequencies of levels of factors.
  • nNumber of spells in indata (possibly after removal of cases with NA's).
  • eventsNumber of events in data.
  • termsUsed by extractor functions.
  • assignUsed by extractor functions.
  • yThe Surv vector.
  • isFLogical vector indicating the covariates that are factors.
  • covarsThe covariates.
  • ttrTotal Time at Risk.
  • levelsList of levels of factors.
  • formulaThe calling formula.
  • callThe call.
  • methodThe method.
  • convergenceDid the optimization converge?
  • failDid the optimization fail? (Is NULL if not).
  • pfixedTRUE if shape was fixed in the estimation.

Warning

The print method print.phreg 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.

Details

The parameterization is the same as in coxreg and coxph, but different from the one used by survreg. The model is $$S(t; a, b, \beta, z) = S_0((t/b)^a)^{\exp(z\beta)}$$ where S0 is some standardized survivor function.

See Also

coxreg, check.dist, link{aftreg}.

Examples

Run this code
data(male.mortality)
fit <- phreg(Surv(enter, exit, event) ~ ses, data = male.mortality)
fit
plot(fit)
fit.cr <- coxreg(Surv(enter, exit, event) ~ ses, data = male.mortality)
check.dist(fit.cr, fit)

Run the code above in your browser using DataLab