Cox Proportional Hazards Regression

DESCRIPTION:
Fits a Cox proportional hazards regression. This function is deprecated; use coxph instead.

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

REQUIRED ARGUMENTS:
time:
vector of time values; all values must be greater than or equal to zero.
Missing values (NA) are allowed.
status:
vector of status values. Typically, the values are 0 or 1, in which case 0 means censored and 1 means 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 status is 1, it is interpreted as meaning that all values are uncensored.
Missing values (NA) are allowed. This vector must be the same length as time.
x:
vector or matrix of explanatory variables. Rows represent observations and columns represent variables. Missing values (NA) are allowed. This must have the same number of rows as the length of time.

OPTIONAL ARGUMENTS:
strata:
numeric vector or category giving the stratum for each observation in a stratified data analysis. The default is to assume no strata.
Missing values (NA) are allowed. This must have the same length as time.
wt:
vector of risk weights. The default is equal weights for all cases.
Missing values (NA) are allowed. This must have the same length as time.
resid:
type of residuals to compute. The possible values are "none", "martingale", "deviance", "score", and "schoenfeld"; only enough of the string to determine a unique match is required.
init:
vector of initial values for the coefficients.
iter.max:
maximum number of iterations to perform.
eps:
convergence criterion. Iteration will stop when the relative change in log-likelihood is less than eps or after iter.max iterations.
table:
logical flag if TRUE the output will include n, a table of counts. This will usually be desired, but for certain types of matched pairs analysis, the table can be both long and superfluous.
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 "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 time, status, x, strata or wt. This is not returned if table is FALSE.
coef:
vector of 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 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 or an Inf in time, status, x, strata, or wt will be deleted from the computations; the residual for such an observation will be NA.

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:
Books that discuss the proportional hazards model include:

Cox, D. R. and Oakes, D. (1984). Analysis of Survival Data. Chapman and Hall, London.

Kalbfleisch, J. D. and Prentice, R. L. (1980). The Statistical Analysis of Failure Time Data. Wiley, New York.

Miller, R. G. (1981). Survival Analysis. Wiley, New York.


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

EXAMPLES:
xx <- coxreg(heart$time, heart$stat, x[,-1], resid="mart") # fit all but column 1
print(xx)                            # nice printout of results
plot(x[,1], xx$resid)                # proper functional form for variable 1?
lines(lowess(x[,1], xx$resid, iter=0))