Learn R Programming

addhazard (version 1.0.0)

ah: Fit Additive Hazards Regression Models

Description

Fit a semiparametric additive hazard model $$\lambda(t|Z=z) = \lambda_0(t) + \beta'z.$$ The estimating procedures follow Lin & Ying (1994).

Usage

ah(formula, data, robust, weights, ...)

Arguments

formula
a formula object for the regression model of the form response ~ predictors. The outcome is a survival object created by Surv.
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.
...
additional arguments to be passed to the low level regression fitting functions (see below).

Value

  • An object of class "ah" representing the fit.

References

Lin, D.Y. & Ying, Z. (1994). Semiparametric analysis of the additive risk model. Biometrika; 81:61-71.

See Also

predict.ah for prediction based on fitted ah model, nwtsco for the description of nwtsco dataset

Examples

Run this code
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 first
nwts_all <- nwtsco
nwts_all$trel <- nwtsco$trel + runif(dim(nwts_all)[1],0,1)*1e-8
fit3 <- ah(Surv(trel,relaps) ~ age + instit, data = nwts_all, robust = TRUE)

Run the code above in your browser using DataLab