Fast Regression for the Accelerated Failure Time (AFT) Model

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Package fastAFT performs fast censored linear regression for the accelerated failure time (AFT) model of Huang (2013).

Installation

fastAFT is available on CRAN:

install.packages("fastAFT")

Fast censored linear regression

This procedure is illustrated with the Mayo primary biliary cholangitis dataset as given in package survival.

## Mayo PBC data
library(survival)
pbc_analy <- as.matrix(na.omit(pbc[,c("time","status","age","edema","bili","albumin","protime")]))
# log transformation for time, bili, albumin, and protime
pbc_analy[,c(1,5:7)] <- log(pbc_analy[,c(1,5:7)])
colnames(pbc_analy)[c(1,5:7)] <- paste("log",colnames(pbc_analy)[c(1,5:7)])
# convert status to censoring indicator
pbc_analy[,2] <- pbc_analy[,2]>1

## Fast censored linear regression
# Gehan weight
library(fastAFT)
fit.g <- faft(pbc_analy[,1],pbc_analy[,2],pbc_analy[,-c(1,2)],weight="Gehan")
fit.g
# logrank weight
fit.l <- faft(pbc_analy[,1],pbc_analy[,2],pbc_analy[,-c(1,2)],weight="logrank")
fit.l

References

Huang, Y. (2013) Fast censored linear regression. Scandinavian Journal of Statistics 40, 789--806.



Try the fastAFT package in your browser

Any scripts or data that you put into this service are public.

fastAFT documentation built on July 9, 2023, 7:05 p.m.