polspline (version 1.1.25)

hare: Hare: hazard regression


Fit a hazard regression model: linear splines are used to model the baseline hazard, covariates, and interactions. Fitted models can be, but do not need to be, proportional hazards models.


hare(data, delta, cov, penalty, maxdim, exclude, include, prophaz = FALSE,
additive = FALSE, linear, fit, silent = TRUE)


An object of class hare, which is organized to serve as input for plot.hare, summary.hare, dhare (conditional density), hhare

(conditional hazard rate), phare (conditional probabilities), qhare

(conditional quantiles), and rhare (random numbers). The object is a list with the following members:


number of covariates.


number of dimensions of the fitted model.


matrix of size ndim x 6. each row is a basis function. First element: first covariate involved (0 means time);

second element: which knot (0 means: constant (time) or linear (covariate));

third element: second covariate involved (NA means: this is a function of one variable);

fourth element: knot involved (if the third element is NA, of no relevance);

fifth element: beta;

sixth element: standard error of beta.


a matrix with ncov rows. Covariate i has row i+1, time has row 1. First column: number of knots in this dimension; other columns: the knots, appended with NAs to make it a matrix.


the parameter used in the AIC criterion.


maximum element of survival data.


column i gives the range of the i-th covariate.


matrix with two columns. The i-th element of the first column is the loglikelihood of the model of dimension i. The second column indicates whether this model was fitted during the addition stage (1) or during the deletion stage (0).


sample size.



vector of observations. Observations may or may not be right censored. All observations should be nonnegative.


binary vector with the same length as data. Elements of data for which the corresponding element of delta is 0 are assumed to be right censored, elements of data for which the corresponding element of delta is 1 are assumed to be uncensored. If delta is missing, all observations are assumed to be uncensored.


covariates: matrix with as many rows as the length of data. May be omitted if there are no covariates. (If there are no covariates, however, heft will provide a more flexible model using cubic splines.)


the parameter to be used in the AIC criterion. The method chooses the number of knots that minimizes -2 * loglikelihood + penalty * (dimension). The default is to use penalty = log(samplesize) as in BIC. The effect of this parameter is summarized in summary.hare.


maximum dimension (default is \(6*\mbox{length(data)}^0.2)\).


combinations to be excluded - this should be a matrix with 2 columns - if for example exclude[1, 1] = 2 and exclude[1, 2] = 3 no interaction between covariate 2 and 3 is included. 0 represents time.


those combinations that can be included. Should have the same format as exclude. Only one of exclude and include can be specified .


should the model selection be restricted to proportional hazards models?


should the model selection be restricted to additive models?


vector indicating for which of the variables no knots should be entered. For example, if linear = c(2, 3) no knots for either covariate 2 or 3 are entered. 0 represents time. The default is none.


hare object. If fit is specified, hare adds basis functions starting with those in fit.


suppresses the printing of diagnostic output about basis functions added or deleted, Rao-statistics, Wald-statistics and log-likelihoods.


Charles Kooperberg clk@fredhutch.org.


Charles Kooperberg, Charles J. Stone and Young K. Truong (1995). Hazard regression. Journal of the American Statistical Association, 90, 78-94.

Charles J. Stone, Mark Hansen, Charles Kooperberg, and Young K. Truong. The use of polynomial splines and their tensor products in extended linear modeling (with discussion) (1997). Annals of Statistics, 25, 1371--1470.

See Also

heft, plot.hare, summary.hare, dhare, hhare, phare, qhare, rhare.


Run this code
fit <- hare(testhare[,1], testhare[,2], testhare[,3:8]) 

Run the code above in your browser using DataLab