eha (version 2.8.5)

pchreg: Piecewise Constant Proportional Hazards Regression

Description

Proportional hazards model with piecewise constant baseline hazard(s). Allows for stratification and left truncated and right censored data.

Usage

pchreg(
  formula = formula(data),
  data = parent.frame(),
  na.action = getOption("na.action"),
  cuts = NULL,
  init,
  control = list(eps = 1e-08, maxiter = 20, trace = FALSE),
  singular.ok = TRUE,
  model = FALSE,
  x = FALSE,
  y = TRUE
)

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.

cuts

Specifies the points in time where the hazard function jumps. If omitted, an exponential model is fitted.

init

vector of initial values of the iteration. Default initial value is zero for all variables.

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?

Value

A list of class "pchreg" with components

coefficients

Fitted parameter estimates.

cuts

Cut points (NULL if no cut points).

hazards

The estimated constant levels.

var

Covariance matrix of the estimates.

loglik

Vector of length two; first component is the value at the initial parameter values, the second component is the maximized value.

score

The score test statistic (at the initial value).

linear.predictors

The estimated linear predictors.

means

Means of the columns of the design matrix, except those columns corresponding to a factor level. Otherwise all zero.

w.means

Weighted (against exposure time) means of covariates; weighted relative frequencies of levels of factors.

n

Number of spells in indata (possibly after removal of cases with NA's).

n.events

Number of events in data.

terms

Used by extractor functions.

assign

Used by extractor functions.

%
wald.test

The Wald test statistic (at the initial value).

y

The Surv vector.

isF

Logical vector indicating the covariates that are factors.

covars

The covariates.

ttr

Total Time at Risk.

levels

List of levels of factors.

formula

The calling formula.

call

The call.

method

The method.

convergence

Did the optimization converge?

fail

Did the optimization fail? (Is NULL if not).

See Also

phreg, coxreg, link{aftreg}.

Examples

Run this code
# NOT RUN {
fit <- pchreg(Surv(enter, exit, event) ~ ses.50 + sex, data = oldmort, 
cuts = seq(60, 100, by = 5))
summary(fit)
fit.cr <- coxreg(Surv(enter, exit, event) ~ ses.50 + sex, data = oldmort)
compHaz(fit.cr, fit)

# }

Run the code above in your browser using DataLab