The routine may be called by the names g12zaf or nagf_surviv_coxmodel_risksets.
The Cox proportional hazards model (see Cox (1972)) relates the time to an event, usually death or failure, to a number of explanatory variables known as covariates. Some of the observations may be right-censored, that is, the exact time to failure is not known, only that it is greater than a known time.
Let , for , be the failure time or censored time for the th observation with the vector of covariates .
It is assumed that censoring and failure mechanisms are independent. The hazard function, , is the probability that an individual with covariates fails at time given that the individual survived up to time . In the Cox proportional hazards model, is of the form
where is the base-line hazard function, an unspecified function of time, and is a vector of unknown parameters. As is unknown, the parameters are estimated using the conditional or marginal likelihood. This involves considering the covariate values of all subjects that are at risk at the time when a failure occurs. The probability that the subject that failed had their observed set of covariate values is computed.
The risk set at a failure time consists of those subjects that fail or are censored at that time and those who survive beyond that time. As risk sets are computed for every distinct failure time, it should be noted that the combined risk sets may be considerably larger than the original data. If the data can be considered as coming from different strata such that varies from strata to strata but remains constant, then g12zaf will return a factor that indicates to which risk set/strata each member of the risk sets belongs rather than just to which risk set.
Given the risk sets the Cox proportional hazards model can then be fitted using a Poisson generalized linear model (g02gcf with g04eaf to compute dummy variables) using Breslow's approximation for ties (see Breslow (1974)). This will give the same fit as g12baf. If the exact treatment of ties in discrete time is required, as given by Cox (1972), then the model is fitted as a conditional logistic model using g11caf.
Breslow N E (1974) Covariate analysis of censored survival data Biometrics30 89–99
Cox D R (1972) Regression models in life tables (with discussion) J. Roy. Statist. Soc. Ser. B34 187–220
Gross A J and Clark V A (1975) Survival Distributions: Reliability Applications in the Biomedical Sciences Wiley
Indicates that the th data point is in the th stratum, where .
Indicates that the th data point is omitted from the analysis.
, for .
11: – IntegerOutput
On exit: the number of values in the combined risk sets.
12: – Integer arrayOutput
On exit: the factor giving the risk sets/strata for the data in x and id.
If or , for members of the th risk set.
If , for the observations in the th risk set for the th strata.
13: – IntegerOutput
On exit: the number of levels for the risk sets/strata factor given in ixs.
14: – Real (Kind=nag_wp) arrayOutput
On exit: the first num rows contain the values of the covariates for the members of the risk sets.
15: – IntegerInput
On entry: the first dimension of the array x and the dimension of the arrays ixs and id as declared in the (sub)program from which g12zaf is called.
mxn must be sufficiently large for the arrays to contain the expanded risk sets. The size will depend on the pattern of failures times and censored times. The minimum value will be returned in num unless the routine exits with or .
16: – Integer arrayOutput
On exit: indicates if the member of the risk set given in x failed.
if the member of the risk set failed at the time defining the risk set and otherwise.
17: – IntegerOutput
On exit: the number of distinct failure times, i.e., the number of risk sets.
18: – Real (Kind=nag_wp) arrayOutput
On exit: contains the th distinct failure time, for .
19: – Integer arrayOutput
On exit: indicates rows in x and elements in ixs and id corresponding to the risk sets. The first risk set corresponding to failure time is given by rows to
. The th risk set is given by rows to , for .
20: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
On entry, and minimum value for .
Constraint: mxn must be sufficiently large for the arrays to contain the expanded risk set.
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g12zaf is not threaded in any implementation.
When there are strata present, i.e., , not all the nxs groups may be present.
The data are the remission times for two groups of leukemia patients (see page 242 of Gross and Clark (1975)). A dummy variable indicates which group they come from. The risk sets are computed using g12zaf and the Cox's proportional hazard model is fitted using g11caf.