hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_nonpar_rank_regsn_censored (g08rb)

Purpose

nag_nonpar_rank_regsn_censored (g08rb) 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.

Syntax

[prvr, irank, zin, eta, vapvec, parest, ifail] = g08rb(nv, y, x, icen, gamma, nmax, tol, 'ns', ns, 'ip', ip)
[prvr, irank, zin, eta, vapvec, parest, ifail] = nag_nonpar_rank_regsn_censored(nv, y, x, icen, gamma, nmax, tol, 'ns', ns, 'ip', ip)

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, θiθi, for i = 1,2,,ni=1,2,,n, are related by θ = Xβθ=Xβ. Here XX is an nn by pp matrix of explanatory variables and ββ is a vector of pp 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 Yj * Yj* with Yj * YjYj*Yj. We rank censored and uncensored observations as follows. Suppose we can observe YjYj, for j = 1,2,,nj=1,2,,n, directly but Yj * Yj*, for j = n + 1,,qj=n+1,,q and nqnq, are censored on the right. We define the rank rjrj of YjYj, for j = 1,2,,nj=1,2,,n, in the usual way; rjrj equals ii if and only if YjYj is the iith smallest amongst the Y1,Y2,,YnY1,Y2,,Yn. The right-censored Yj * Yj*, for j = n + 1,n + 2,,qj=n+1,n+2,,q, has rank rjrj if and only if Yj * Yj* lies in the interval [Y(rj),Y(rj + 1)][Y(rj),Y(rj+1)], with Y0 = Y0=-, Y(n + 1) = + Y(n+1)=+ and Y(1) < < Y(n)Y(1)<<Y(n) the ordered YjYj, for j = 1,2,,nj=1,2,,n.
The distribution of the YY is assumed to be of the following form. Let FL (y) = ey / (1 + ey)FL (y)=ey/(1+ey), the logistic distribution function, and consider the distribution function Fγ(y)Fγ(y) defined by 1Fγ = [1FL(y)]1 / γ 1-Fγ=[1-FL(y)] 1/γ . This distribution function can be thought of as either the distribution function of the minimum, X1,γX1,γ, of a random sample of size γ1γ-1 from the logistic distribution, or as the Fγ(ylogγ)Fγ(y-logγ) being the distribution function of a random variable having the FF-distribution with 22 and 2γ12γ-1 degrees of freedom. This family of generalized logistic distribution functions [Fγ( . );0γ < ][Fγ(.);0γ<] naturally links the symmetric logistic distribution (γ = 1)(γ=1) with the skew extreme value distribution (limγ0limγ0) and with the limiting negative exponential distribution (limγlimγ). For this family explicit results are available for right-censored data. See Pettitt (1983) for details.
Let lRlR denote the logarithm of the rank marginal likelihood of the observations and define the q × 1q×1 vector aa by a = lR(θ = 0)a=lR(θ=0), and let the qq by qq diagonal matrix BB and qq by qq symmetric matrix AA be given by BA = lR(θ = 0)B-A=-lR(θ=0). Then various statistics can be found from the analysis.
(a) The score statistic XTaXTa. This statistic is used to test the hypothesis H0 : β = 0H0:β=0 (see (e)).
(b) The estimated variance-covariance matrix of the score statistic in (a).
(c) The estimate β̂R = MXTaβ^R=MXTa.
(d) The estimated variance-covariance matrix M = (XT(BA)X)1M=(XT(B-A)X) -1 of the estimate β̂Rβ^R.
(e) The χ2χ2 statistic Q = β̂RM1​ ​β̂r = aTX(XT(BA)X)1XTaQ=β^RM-1​ ​β^r=aTX(XT(B-A)X) -1XTa, used to test H0 : β = 0H0:β=0. Under H0H0, QQ has an approximate χ2χ2-distribution with pp degrees of freedom.
(f) The standard errors Mii1 / 2Mii 1/2 of the estimates given in (c).
(g) Approximate zz-statistics, i.e., Zi = β̂Ri / se(β̂Ri)Zi=β^Ri/se(β^Ri) for testing H0 : βi = 0H0:βi=0. For i = 1,2,,ni=1,2,,n, ZiZi has an approximate N(0,1)N(0,1) distribution.
In many situations, more than one sample of observations will be available. In this case we assume the model,
hk (Yk) = XkT β + ek ,   k = 1,2,,ns ,
hk (Yk) = XkT β+ek ,   k=1,2,,ns ,
where ns is the number of samples. In an obvious manner, YkYk and XkXk are the vector of observations and the design matrix for the kkth sample respectively. Note that the arbitrary transformation hkhk 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 β̂ = Ddβ^=Dd, where
ns
D1 = XT(BkAk)Xk
k = 1
D-1=k=1nsXT(Bk-Ak)Xk
and
ns
d = XkTak,
k = 1
d=k= 1ns XkT ak ,
with akak, BkBk and AkAk defined as aa, BB and AA above but for the kkth sample.
The remaining statistics are calculated as for the one sample case.

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

Parameters

Compulsory Input Parameters

1:     nv(ns) – int64int32nag_int array
ns, the dimension of the array, must satisfy the constraint ns1ns1.
The number of observations in the iith sample, for i = 1,2,,nsi=1,2,,ns.
Constraint: nv(i)1nvi1, for i = 1,2,,nsi=1,2,,ns.
2:     y(nsum) – double array
nsum, the dimension of the array, must satisfy the constraint nsum = i = 1ns nv(i) nsum= i=1 ns nvi .
The observations in each sample. Specifically, y( k = 1i1 nv(k) + j ) y k=1 i-1 nvk+j  must contain the jjth observation in the iith sample.
3:     x(ldx,ip) – double array
ldx, the first dimension of the array, must satisfy the constraint ldxnsumldxnsum.
The design matrices for each sample. Specifically, x( k = 1i1 nv(k) + j ,l) x k=1 i-1 nvk + j l  must contain the value of the llth explanatory variable for the jjth observations in the iith sample.
Constraint: xx must not contain a column with all elements equal.
4:     icen(nsum) – int64int32nag_int array
nsum, the dimension of the array, must satisfy the constraint nsum = i = 1ns nv(i) nsum= i=1 ns nvi .
Defines the censoring variable for the observations in y.
icen(i) = 0iceni=0
If y(i)yi is uncensored.
icen(i) = 1iceni=1
If y(i)yi is censored.
Constraint: icen(i) = 0iceni=0 or 11, for i = 1,2,,nsumi=1,2,,nsum.
5:     gamma – double scalar
The value of the parameter defining the generalized logistic distribution. For gamma0.0001gamma0.0001, the limiting extreme value distribution is assumed.
Constraint: gamma0.0gamma0.0.
6:     nmax – int64int32nag_int scalar
The value of the largest sample size.
Constraint: nmax = max1ins (nv(i))nmax=max1ins(nvi) and nmax > ipnmax>ip.
7:     tol – double scalar
The tolerance for judging whether two observations are tied. Thus, observations YiYi and YjYj are adjudged to be tied if |YiYj| < tol|Yi-Yj|<tol.
Constraint: tol > 0.0tol>0.0.

Optional Input Parameters

1:     ns – int64int32nag_int scalar
Default: The dimension of the array nv.
The number of samples.
Constraint: ns1ns1.
2:     ip – int64int32nag_int scalar
Default: The second dimension of the array x.
The number of parameters to be fitted.
Constraint: ip1ip1.

Input Parameters Omitted from the MATLAB Interface

nsum ldx ldprvr work lwork iwa

Output Parameters

1:     prvr(ldprvr,ip) – double array
ldprvrip + 1ldprvrip+1.
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 1ijip1ijip, prvr(i,j)prvrij contains an estimate of the covariance between the iith and jjth score statistics. For 1jiip11jiip-1, prvr(i + 1,j)prvri+1j contains an estimate of the covariance between the iith and jjth parameter estimates.
2:     irank(nmax) – int64int32nag_int array
For the one sample case, irank contains the ranks of the observations.
3:     zin(nmax) – double array
For the one sample case, zin contains the expected values of the function g( . )g(.) of the order statistics.
4:     eta(nmax) – double array
For the one sample case, eta contains the expected values of the function g( . )g(.) of the order statistics.
5:     vapvec(nmax × (nmax + 1) / 2nmax×(nmax+1)/2) – double array
For the one sample case, vapvec contains the upper triangle of the variance-covariance matrix of the function g( . )g(.) of the order statistics stored column-wise.
6:     parest(4 × ip + 14×ip+1) – double array
The statistics calculated by the function.
The first ip components of parest contain the score statistics.
The next ip elements contain the parameter estimates.
parest(2 × ip + 1)parest2×ip+1 contains the value of the χ2χ2 statistic.
The next ip elements of parest contain the standard errors of the parameter estimates.
Finally, the remaining ip elements of parest contain the zz-statistics.
7:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,ns < 1ns<1,
ortol0.0tol0.0,
ornmaxipnmaxip,
orldprvr < ip + 1ldprvr<ip+1,
orldx < nsumldx<nsum,
ornmaxmax1ins (nv(i))nmaxmax1ins (nvi),
ornv(i)0nvi0 for some ii, i = 1,2,,nsi=1,2,,ns,
ornsumi = 1nsnv(i)nsumi=1nsnvi,
orip < 1ip<1,
orgamma < 0.0gamma<0.0,
orlwork < nmax × (ip + 1)lwork<nmax×(ip+1).
  ifail = 2ifail=2
On entry,icen(i)0iceni0 or 11, for some 1insum1insum.
  ifail = 3ifail=3
On entry, all the observations are adjudged to be tied. You are advised to check the value supplied for tol.
  ifail = 4ifail=4
The matrix XT(BA)XXT(B-A)X is either ill-conditioned or not positive definite. This error should only occur with extreme rankings of the data.
  ifail = 5ifail=5
On entry,at least one column of the matrix XX has all its elements equal.

Accuracy

The computations are believed to be stable.

Further Comments

The time taken by nag_nonpar_rank_regsn_censored (g08rb) 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.

Example

function nag_nonpar_rank_regsn_censored_example
nv = [int64(40)];
y = [143;
     164;
     188;
     188;
     190;
     192;
     206;
     209;
     213;
     216;
     220;
     227;
     230;
     234;
     246;
     265;
     304;
     216;
     244;
     142;
     156;
     163;
     198;
     205;
     232;
     232;
     233;
     233;
     233;
     233;
     239;
     240;
     261;
     280;
     280;
     296;
     296;
     323;
     204;
     344];
x = [0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1];
icen = [int64(0);0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;1];
gamma = 1e-05;
nmax = int64(40);
tol = 1e-05;
[parvar, irank, zin, eta, vapvec, parest, ifail] = ...
    nag_nonpar_rank_regsn_censored(nv, y, x, icen, gamma, nmax, tol);
 parvar, parest, ifail
 

parvar =

    7.6526
    0.1307


parest =

    4.5840
    0.5990
    2.7459
    0.3615
    1.6571


ifail =

                    0


function g08rb_example
nv = [int64(40)];
y = [143;
     164;
     188;
     188;
     190;
     192;
     206;
     209;
     213;
     216;
     220;
     227;
     230;
     234;
     246;
     265;
     304;
     216;
     244;
     142;
     156;
     163;
     198;
     205;
     232;
     232;
     233;
     233;
     233;
     233;
     239;
     240;
     261;
     280;
     280;
     296;
     296;
     323;
     204;
     344];
x = [0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     0;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1;
     1];
icen = [int64(0);0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;1];
gamma = 1e-05;
nmax = int64(40);
tol = 1e-05;
[parvar, irank, zin, eta, vapvec, parest, ifail] = ...
    g08rb(nv, y, x, icen, gamma, nmax, tol);
 parvar, parest, ifail
 

parvar =

    7.6526
    0.1307


parest =

    4.5840
    0.5990
    2.7459
    0.3615
    1.6571


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013