gamcox {MapGAM} | R Documentation |
Fit a Cox Additive Model with a Two-Dimensional Smooth
Description
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).
Usage
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)
Arguments
formula |
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 |
data |
a data frame containing the variables in the model.If not found in |
Y , X |
for |
smooth.frame |
the model matrix for the smooth term. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
weights |
an optional vector of weights to be used in the fitting process. |
span |
the span size for the LOESS smooth of the two-dimensional predictor, which controls the degree of smoothing. |
I.span |
the span size for the LOESS smooth of the Fisher information. |
degree |
the degree of the polynomials to be used for LOESS smooth, normally 1 or 2. |
loess.trace |
whether the trace of the smoother matrix be computed exactly ( |
Maxiter |
the maximum number of iterations in backfitting algorithm. |
tol |
the tolerence threshold for convergence. |
Details
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.
Value
gamcox
returns an object of class gamcox
. It can be examined by print
and predict
.
coefficients |
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. |
additive.predictors |
the additive fit, given by the product of the model matrix and the coefficients, plus the columns of the |
smooth |
estimated smoothing term. Nonlinear part of the spatial effect on survival rates. |
var |
the approximate pointwise variances for the columns of smooth. |
residuals |
the residuals from the final weighted additive fit; also known as residuals, these are typically not interpretable without rescaling by the weights. |
deviance |
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. |
df.residual |
the residual degrees of freedom. |
aic |
AIC of the fitted model. |
Author(s)
Lu Bai
Send bug reports to sbartell@uci.edu.
References
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)
See Also
Examples
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)