Fits a Cox proportional hazard additive model with a two-dimensional LOESS smooth for geolocation (or any other two-dimensional predictor). gamcox
uses the backfitting algorithm to combine the smoothing and fitting methods. The smoothing method currently supported is local regression (LOESS).
gamcox(formula, data, subset, weights, span=0.5, I.span=0.2, degree = 1,
loess.trace = "exact", Maxiter = 40, tol = 1e-07)gamcox.fit(Y, X, smooth.frame, weights, span=0.5, I.span=0.2, degree = 1,
loess.trace = "exact", Maxiter = 40, tol = 1e-07)
gamcox
returns an object of class gamcox
. It can be examined by print
and predict
.
a named vector of coefficients for the parametric part of the additive predictors, which multiply the columns of the model matrix. The names of the coefficients are the names of the single-degree-of-freedom effects (the columns of the model matrix). If the model is overdetermined there will be missing values in the coefficients corresponding to inestimable coefficients.
the additive fit, given by the product of the model matrix and the coefficients, plus the columns of the $smooth
component.
estimated smoothing term. Nonlinear part of the spatial effect on survival rates.
the approximate pointwise variances for the columns of smooth.
the residuals from the final weighted additive fit; also known as residuals, these are typically not interpretable without rescaling by the weights.
up to a constant, minus twice the maximized log-likelihood. Similar to the residual sum of squares. Where sensible, the constant is chosen so that a saturated model has deviance zero.
the residual degrees of freedom.
AIC of the fitted model.
a formula expression (required), with the response on the left of a ~ oprator, and the predictors on the right. The response must be a survival object as returned by the Surv function. A built-in nonparametric smoothing term is indicated by lo
for loess smooth terms. The two-dimensional predictor (e.g.,geolocation) should be specified as auguments in lo()
.
a data frame containing the variables in the model.If not found in data
, the variables are taken from environment(formula)
.
for gamcox.fit
: Y
is a list including two elements: time
for survival times and event
for censoring status. X
is a data frame containing the variables in the model. The data must be structured so that the X and Y coordinates for two-dimensional predictor (e.g., geolocation) are in the 1st and 2nd columns, respectively.
the model matrix for the smooth term.
an optional vector specifying a subset of observations to be used in the fitting process.
an optional vector of weights to be used in the fitting process.
the span size for the LOESS smooth of the two-dimensional predictor, which controls the degree of smoothing.
the span size for the LOESS smooth of the Fisher information.
the degree of the polynomials to be used for LOESS smooth, normally 1 or 2.
whether the trace of the smoother matrix be computed exactly ("exact"
) or approximately ("approximate"
). It is recommended to use "approximate"
for more than about 1000 data points.
the maximum number of iterations in backfitting algorithm.
the tolerence threshold for convergence.
Lu Bai
Send bug reports to sbartell@uci.edu.
The model used to fit the data is a Cox proportional hazard additive model with a LOESS smooth for a two-dimensional predictor such as geolocation (Hastie and Tibshirani, 1990): $$\boldsymbol{\lambda}(t)=\boldsymbol{\lambda}_{0}(t)\exp\left\{ S(x_{i},y_{i}) + \mathbf{Z_{i}} \boldsymbol{\beta}\right\}$$ where \(\boldsymbol{\lambda}(t)\) is the hazard at time t for participant i, \(x_{i}\) and \(y_{i}\) are predictor coordinates for participant i (i.e., projected distance east and north, respectively, from an arbitrarily defined origin location), S(.,.) is a 2-dimensional smoothing function (currently LOESS), \(\mathbf{Z_{i}}\) is a row vector of covariate values for participant i, and \(\boldsymbol{\beta}\) is a vector of unknown regression parameters. See the references for more details.
Hastie TJ, Tibshirani RJ. Generalized Additive Models. (Chapman & Hall/CRC Monographs on Statistics & Applied Probability, Boca Raton, Florida, 1990).
Bristow RE, Chang J, Ziogas A, Gillen DL, Bai L, Vieira VM. Spatial Analysis of Advanced-stage Ovarian Cancer Mortality in California. American Journal of Obstetrics and Gynecology 2015, 213(1), e1-43)
modgam
,
predict.gamcox
.
# \donttest{
data(CAdata)
data(CAmap)
fit <- gamcox(Surv(time,event)~AGE + factor(INS) + lo(X,Y),data=CAdata,
span=0.2,loess.trace="approximate")
fit
pred = predict(fit)
colormap(list(fit=pred$pred,grid=data.frame(X=CAdata$X,Y=CAdata$Y)),map=CAmap,
border.gray=0.5)
# }
Run the code above in your browser using DataLab