Andersen-Gill Proportional Hazards Model

DESCRIPTION:
Extension of the Cox regression model to multiple events and/or time dependent covariates. This function is deprecated; use coxph instead.

USAGE:
agreg(start, stop, event, x, strata=rep(1, length(start)), wt=
      rep(1, length(start)), resid="none", init=rep(0, ncol(x)),
      eps=0.0001, iter.max=10, table=T, inf.ratio=2000)

REQUIRED ARGUMENTS:
start:
vector of start times. Each row represents an interval of observation (start, stop]. An event, if there is one, is assumed to have occurred at time stop.
Missing values (NA) are allowed.
stop:
vector of stop times.
Missing values (NA) are allowed.
event:
vector of events: did an event occur at time stop? Typically, the values are 0 or 1, in which case 0 means no or censored and 1 means yes or uncensored (dead). The values can also be 1 and 2, in which case 1 is subtracted from all of the values. If the only value in event is 1, then this is interpreted as meaning that all values are uncensored. Missing values (NA) are allowed.
x:
vector or matrix of explanatory variables. Each column is a variable, each row an observation. A given subject whose covariates change could be split up across multiple rows, by using (start, time1], (time1, time2], ...., (timek, stop] as the start-stop pairs. A subject with multiple events (each at a different time, of course) will always be split over multiple rows. Missing values (NA) are allowed.

OPTIONAL ARGUMENTS:
strata:
vector giving the strata levels for each observation. The default is to assume no strata.
wt:
vector of risk weights.
resid:
type of residual to be computed. The possible values are "none", "martingale", "score", or "schoenfeld". Only enough of the string to determine a unique match is required.
init:
vector of initial values for the coefficients.
eps:
convergence criterion: iteration will continue until the relative change in the log-likelihood is less than eps.
iter.max:
maximum number of iterations allowed. A value of 0 is commonly used to obtain the martingale residuals from a null model. A smoothed plot of these versus an x covariate will give a first approximation to the appropriate functional form for that covariate.
table:
logical flag, if TRUE the output will include n, a table of counts.
inf.ratio:
a bound for the "average" risk ratio associated with a covariate. In certain cases (e.g. a dichotomous variable with one group containing no events) the actual MLE estimate of a coefficient is infinity. The associated coeficient will grow at a steady pace and a race condition will exist in the fitting routine, either the log-likelihood will converge, the information matrix will become effectively singular, the maximum number of iterations will be exceeded, or the "average" risk ratio associated with the covariate will be deemed greater than inf.ratio. In the latter case, a warning message is printed.

VALUE:
a list of class c("agreg","coxreg") representing the results of the regression, with the following components:
n:
a table with one row per stratum, and columns for the number of censored observations, the number of uncensored observations, and the number of observations not used in the regression due to missing values for start, stop, x, strata or event. This is not returned if table = FALSE.
coef:
vector of fitted coefficients.
var:
variance-covariance matrix of the coefficients.
loglik:
vector of length 2 containing the log likelihood of the model with the initial values and with the final values of the coefficients.
score:
value of the efficient score test for the initial values of the coefficients.
iter:
number of iterations used.
resid:
if the requested residual is "none", this component is absent. For "martingale" or "deviance" residuals, this is a vector; observations not used in the regression due to missing values have residuals that are NA. If the requested residual is "score", the result is a matrix with one column for each explanatory variable (a vector if there is only one explanatory variable), and one row for each observation. If "schoenfeld" residuals are requested, the result is a matrix with one column for each explanatory variable (a vector if there is only one explanatory variable), and one row for each death time. Note: if the time value 5 were to occur in two different strata, it would be considered as two distinct times by this routine.
time:
this component is present only if "schoenfeld" residuals have been produced. It contains the list of times corresponding to the Schoenfeld residuals, and is in sorted order.
strata:
this component is present only for "schoenfeld" residuals. It contains the strata value for each residual.

DETAILS:
Any observation that has a missing value (NA), or Inf in start, stop, x, strata or event will be deleted from the computations; the residual for such an observation will be NA.

The proportional hazards model is usually expressed in terms of a single survival time value for each person, with possible censoring. Andersen and Gill reformulated the same problem as a counting process; as time marches onward we observe the events for a subject, rather like watching a Geiger counter. Extensions to the Cox model are readily apparent: time dependent covariates, multiple events, and discontinuous observation periods for a single subject. A martingale formulation of the counting process leads to direct proofs of asymptotic properties, and to a useful set of residuals.

One use of risk weights is to set certain coeficients at a fixed value, much like the offset statement of a generalized linear model (see glim). Assume that the coeficients for say, age and sex, have been fixed from an outside study, perhaps national death rates, and we wish to adjust for them without estimating the terms. Then a weight of exp(beta1*age+beta2*sex) would be used.


REFERENCES:
Andersen, P. and Gill, R. (1982). Cox's regression model for counting processes a large sample study. Annals of Statistics 10, 1100-1120.

Fleming, T. R. and Harrington, D. P. (1991). Counting Processes and Survival Analysis. Wiley, New York.

Therneau, T., Grambsch, P. and Fleming, T. (1990). Martingale-based residuals for survival models. Biometrika 77, 147-160.


SEE ALSO:
coxreg , print.coxreg , surv.fit , surv.diff .

EXAMPLES:
xx24 <- agreg(heart$start, heart$stop, heart$event, xx[, c(2,4)])
print(xx24)                     # nice printout of results.