Description Usage Arguments Value Note References See Also Examples
Fit a semiparametric additive hazard model '
λ(t|Z=z) = λ_0(t) + β'z.
The estimating procedures follow Lin & Ying (1994).
1 |
formula |
a formula object for the regression model of the form
response ~ predictors. The outcome is a survival object created by
|
data |
a data frame. Input dataset. |
robust |
a logical variable. Robust standard errors are provided if robust == TRUE. |
weights |
a numeric vector. The weight of each observation. |
ties |
a string. If there are ties in the survival time, when ties = 'break' a small random number is added to the survival time to break the ties. |
seed |
an integer. Seed number used to generate random increment when breaking ties. The default number is 20. |
... |
additional arguments to be passed to the low level regression fitting functions. |
An object of class 'ah' representing the fit.
The response variable is a survival object. The regression
model can be univariate or multivariate. This function is built upon the function
ahaz
by Anders Gorst-Rasmussen.
Lin, D.Y. & Ying, Z. (1994). Semiparametric analysis of the additive risk model. Biometrika; 81:61-71.
predict.ah
for prediction based on fitted
ah
model, nwtsco
for the description of nwtsco dataset
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(survival)
### using the first 100 rows in nwtsco to build an additive hazards model
nwts<- nwtsco[1:100,]
### fit the additive hazards model to the data
### the model-based standard errors are reported when setting robust = FALSE
fit1 <- ah(Surv(trel,relaps) ~ age + instit, data = nwts, robust = FALSE)
summary(fit1)
### fit the additive hazards model to the data with robust standard errors
fit2 <- ah(Surv(trel,relaps) ~ age + instit, data = nwts, robust = TRUE)
summary(fit2)
### when there are ties, break the ties by setting ties = 'break'
nwts_all <- nwtsco
fit3 <- ah(Surv(trel,relaps) ~ age + instit, ties = 'break', data = nwts_all, robust = TRUE)
summary(fit3)
### users could break the ties on their own by
nwts_all$trel <- nwtsco$trel + runif(dim(nwts_all)[1],0,1)*1e-10
fit3 <- ah(Surv(trel,relaps) ~ age + instit, data = nwts_all, robust = TRUE)
summary(fit3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.