NAG Library Routine Document
g08rbf
(rank_regsn_censored)
1
Purpose
g08rbf calculates the parameter estimates, score statistics and their variance-covariance matrices for the linear model using a likelihood based on the ranks of the observations when some of the observations may be right-censored.
2
Specification
Fortran Interface
Subroutine g08rbf ( |
ns,
nv,
nsum,
y,
ip,
x,
ldx,
icen,
gamma,
nmax,
tol,
prvr,
ldprvr,
irank,
zin,
eta,
vapvec,
parest,
work,
lwork,
iwa,
ifail) |
Integer, Intent (In) | :: |
ns,
nv(ns),
nsum,
ip,
ldx,
icen(nsum),
nmax,
ldprvr,
lwork | Integer, Intent (Inout) | :: |
ifail | Integer, Intent (Out) | :: |
irank(nmax),
iwa(4*nmax) | Real (Kind=nag_wp), Intent (In) | :: |
y(nsum),
x(ldx,ip),
gamma,
tol | Real (Kind=nag_wp), Intent (Inout) | :: |
prvr(ldprvr,ip) | Real (Kind=nag_wp), Intent (Out) | :: |
zin(nmax),
eta(nmax),
vapvec(nmax*(nmax+1)/2),
parest(4*ip+1),
work(lwork) |
|
C Header Interface
#include nagmk26.h
void |
g08rbf_ (
const Integer *ns,
const Integer nv[],
const Integer *nsum,
const double y[],
const Integer *ip,
const double x[],
const Integer *ldx,
const Integer icen[],
const double *gamma,
const Integer *nmax,
const double *tol,
double prvr[],
const Integer *ldprvr,
Integer irank[],
double zin[],
double eta[],
double vapvec[],
double parest[],
double work[],
const Integer *lwork,
Integer iwa[],
Integer *ifail) |
|
3
Description
Analysis of data can be made by replacing observations by their ranks. The analysis produces inference for the regression model where the location parameters of the observations,
, for
, are related by
. Here
is an
by
matrix of explanatory variables and
is a vector of
unknown regression parameters. The observations are replaced by their ranks and an approximation, based on Taylor's series expansion, made to the rank marginal likelihood. For details of the approximation see
Pettitt (1982).
An observation is said to be right-censored if we can only observe with . We rank censored and uncensored observations as follows. Suppose we can observe , for , directly but , for and , are censored on the right. We define the rank of , for , in the usual way; equals if and only if is the th smallest amongst the . The right-censored , for , has rank if and only if lies in the interval , with , and the ordered , for .
The distribution of the
is assumed to be of the following form. Let
, the logistic distribution function, and consider the distribution function
defined by
. This distribution function can be thought of as either the distribution function of the minimum,
, of a random sample of size
from the logistic distribution, or as the
being the distribution function of a random variable having the
-distribution with
and
degrees of freedom. This family of generalized logistic distribution functions
naturally links the symmetric logistic distribution
with the skew extreme value distribution (
) and with the limiting negative exponential distribution (
). For this family explicit results are available for right-censored data. See
Pettitt (1983) for details.
Let
denote the logarithm of the rank marginal likelihood of the observations and define the
vector
by
, and let the
by
diagonal matrix
and
by
symmetric matrix
be given by
. Then various statistics can be found from the analysis.
(a) |
The score statistic . This statistic is used to test the hypothesis (see (e)). |
(b) |
The estimated variance-covariance matrix of the score statistic in (a). |
(c) |
The estimate . |
(d) |
The estimated variance-covariance matrix of the estimate . |
(e) |
The statistic , used to test . Under , has an approximate -distribution with degrees of freedom. |
(f) |
The standard errors of the estimates given in (c). |
(g) |
Approximate -statistics, i.e., for testing . For , has an approximate distribution. |
In many situations, more than one sample of observations will be available. In this case we assume the model,
where
ns is the number of samples. In an obvious manner,
and
are the vector of observations and the design matrix for the
th sample respectively. Note that the arbitrary transformation
can be assumed different for each sample since observations are ranked within the sample.
The earlier analysis can be extended to give a combined estimate of
as
, where
and
with
,
and
defined as
,
and
above but for the
th sample.
The remaining statistics are calculated as for the one sample case.
4
References
Kalbfleisch J D and Prentice R L (1980) The Statistical Analysis of Failure Time Data Wiley
Pettitt A N (1982) Inference for the linear model using a likelihood based on ranks J. Roy. Statist. Soc. Ser. B 44 234–243
Pettitt A N (1983) Approximate methods using ranks for regression with censored data Biometrika 70 121–132
5
Arguments
- 1: – IntegerInput
-
On entry: the number of samples.
Constraint:
.
- 2: – Integer arrayInput
-
On entry: the number of observations in the
th sample, for .
Constraint:
, for .
- 3: – IntegerInput
-
On entry: the total number of observations.
Constraint:
.
- 4: – Real (Kind=nag_wp) arrayInput
-
On entry: the observations in each sample. Specifically, must contain the th observation in the th sample.
- 5: – IntegerInput
-
On entry: the number of parameters to be fitted.
Constraint:
.
- 6: – Real (Kind=nag_wp) arrayInput
-
On entry: the design matrices for each sample. Specifically, must contain the value of the th explanatory variable for the th observations in the th sample.
Constraint:
must not contain a column with all elements equal.
- 7: – IntegerInput
-
On entry: the first dimension of the array
x as declared in the (sub)program from which
g08rbf is called.
Constraint:
.
- 8: – Integer arrayInput
-
On entry: defines the censoring variable for the observations in
y.
- If is uncensored.
- If is censored.
Constraint:
or , for .
- 9: – Real (Kind=nag_wp)Input
-
On entry: the value of the parameter defining the generalized logistic distribution. For , the limiting extreme value distribution is assumed.
Constraint:
.
- 10: – IntegerInput
-
On entry: the value of the largest sample size.
Constraint:
and .
- 11: – Real (Kind=nag_wp)Input
-
On entry: the tolerance for judging whether two observations are tied. Thus, observations and are adjudged to be tied if .
Constraint:
.
- 12: – Real (Kind=nag_wp) arrayOutput
-
On exit: the variance-covariance matrices of the score statistics and the parameter estimates, the former being stored in the upper triangle and the latter in the lower triangle. Thus for , contains an estimate of the covariance between the th and th score statistics. For , contains an estimate of the covariance between the th and th parameter estimates.
- 13: – IntegerInput
-
On entry: the first dimension of the array
prvr as declared in the (sub)program from which
g08rbf is called.
Constraint:
.
- 14: – Integer arrayOutput
-
On exit: for the one sample case,
irank contains the ranks of the observations.
- 15: – Real (Kind=nag_wp) arrayOutput
-
On exit: for the one sample case,
zin contains the expected values of the function
of the order statistics.
- 16: – Real (Kind=nag_wp) arrayOutput
-
On exit: for the one sample case,
eta contains the expected values of the function
of the order statistics.
- 17: – Real (Kind=nag_wp) arrayOutput
-
On exit: for the one sample case,
vapvec contains the upper triangle of the variance-covariance matrix of the function
of the order statistics stored column-wise.
- 18: – Real (Kind=nag_wp) arrayOutput
-
On exit: the statistics calculated by the routine.
The first
ip components of
parest contain the score statistics.
The next
ip elements contain the parameter estimates.
contains the value of the statistic.
The next
ip elements of
parest contain the standard errors of the parameter estimates.
Finally, the remaining
ip elements of
parest contain the
-statistics.
- 19: – Real (Kind=nag_wp) arrayWorkspace
- 20: – IntegerInput
-
On entry: the dimension of the array
work as declared in the (sub)program from which
g08rbf is called.
Constraint:
.
- 21: – Integer arrayWorkspace
-
- 22: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value 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).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, | , |
or | , |
or | , |
or | , |
or | , |
or | , |
or | for some , , |
or | , |
or | , |
or | , |
or | . |
-
On entry, | or , for some . |
-
On entry, all the observations are adjudged to be tied. You are advised to check the value supplied for
tol.
-
The matrix is either ill-conditioned or not positive definite. This error should only occur with extreme rankings of the data.
-
On entry, | at least one column of the matrix has all its elements equal. |
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
The computations are believed to be stable.
8
Parallelism and Performance
g08rbf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g08rbf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken by g08rbf depends on the number of samples, the total number of observations and the number of parameters fitted.
In extreme cases the parameter estimates for certain models can be infinite, although this is unlikely to occur in practice. See
Pettitt (1982) for further details.
10
Example
This example fits a regression model to a single sample of observations using just one explanatory variable.
10.1
Program Text
Program Text (g08rbfe.f90)
10.2
Program Data
Program Data (g08rbfe.d)
10.3
Program Results
Program Results (g08rbfe.r)