naginterfaces.library.nonpar.rank_regsn_censored¶
- naginterfaces.library.nonpar.rank_regsn_censored(nv, y, x, icen, gamma, nmax, tol)[source]¶
rank_regsn_censored
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.For full information please refer to the NAG Library document for g08rb
https://www.nag.com/numeric/nl/nagdoc_30/flhtml/g08/g08rbf.html
- Parameters
- nvint, array-like, shape
The number of observations in the th sample, for .
- yfloat, array-like, shape
The observations in each sample. Specifically, must contain the th observation in the th sample.
- xfloat, array-like, shape
The design matrices for each sample. Specifically, must contain the value of the th explanatory variable for the th observations in the th sample.
- icenint, array-like, shape
Defines the censoring variable for the observations in .
If is uncensored.
If is censored.
- gammafloat
The value of the parameter defining the generalized logistic distribution. For , the limiting extreme value distribution is assumed.
- nmaxint
The value of the largest sample size.
- tolfloat
The tolerance for judging whether two observations are tied. Thus, observations and are adjudged to be tied if .
- Returns
- prvrfloat, ndarray, shape
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.
- irankint, ndarray, shape
For the one sample case, contains the ranks of the observations.
- zinfloat, ndarray, shape
For the one sample case, contains the expected values of the function of the order statistics.
- etafloat, ndarray, shape
For the one sample case, contains the expected values of the function of the order statistics.
- vapvecfloat, ndarray, shape
For the one sample case, contains the upper triangle of the variance-covariance matrix of the function of the order statistics stored column-wise.
- parestfloat, ndarray, shape
The statistics calculated by the function.
The first components of contain the score statistics.
The next elements contain the parameter estimates.
contains the value of the statistic.
The next elements of contain the standard errors of the parameter estimates.
Finally, the remaining elements of contain the -statistics.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, elements of .
Constraint: .
- (errno )
On entry, elements of are out of range.
Constraint: or , for all .
- (errno )
On entry, all the observations were adjudged to be tied.
- (errno )
The matrix is either ill-conditioned or not positive definite.
- (errno )
On entry, for , for all .
Constraint: for at least one .
- Notes
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 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 diagonal matrix and symmetric matrix be given by . Then various statistics can be found from the analysis.
The score statistic . This statistic is used to test the hypothesis (see (e)).
The estimated variance-covariance matrix of the score statistic in (a).
The estimate .
The estimated variance-covariance matrix of the estimate .
The statistic , used to test . Under , has an approximate -distribution with degrees of freedom.
The standard errors of the estimates given in (c).
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 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.
- 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