Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Package fastAFT
performs fast censored linear regression for the accelerated
failure time (AFT) model of Huang (2013).
fastAFT
is available on CRAN:
install.packages("fastAFT")
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
Huang, Y. (2013) Fast censored linear regression. Scandinavian Journal of Statistics 40, 789--806.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.