Title: | Fit Linear Transformation Models for Right Censored Data |
---|---|
Description: | A unified estimation procedure for the analysis of right censored data using linear transformation models. An introduction can be found in Jie Zhou et al. (2022) <doi:10.18637/jss.v101.i09>. |
Authors: | Jie Zhou, Jiajia Zhang, Wenbin Lu |
Maintainer: | Jie Zhou <[email protected]> |
License: | GPL-2 |
Version: | 2.3 |
Built: | 2024-11-23 06:19:08 UTC |
Source: | https://github.com/cran/TransModel |
Semiparametric analysis for linear transformation model, such as the proportional hazards model and the proportional odds model, is fitted based on a unified method proposed in Chen(2002) for right censored survival data.
The main function TransModel gives estimates for coefficients and covariance matrix for the predictors in the linear transformation model. Print and summary method can be applied to the returned object.
Jie Zhou, Jiajia Zhang, Wenbin Lu
Maintainer: Jie Zhou <[email protected]>
Kani Chen, et al., Semiparametric analysis of transformation models with censored data. Biometrika, 89(3), 659-668, 2002.
Jie Zhou, Jiajia Zhang, Wenbin Lu. An R Package for Linear Transformation Model with Censored Data. Journal of Statistical Software, 101(1), 1-12, 2022.
This data set is randomly generated from the proportional hazards transformation model as an example.
data(PH_examp)
data(PH_examp)
A data frame containing survival time, right censoring indicator, predictors gender and age, and a trivial variable called error.
Survival curve with confidence interval or confidence band will be plotted for the returned object from predict.TransModel.
## S3 method for class 'predict.TransModel' plot(x, CI = FALSE, CB = FALSE, ...)
## S3 method for class 'predict.TransModel' plot(x, CI = FALSE, CB = FALSE, ...)
x |
An object from the function predict.TransModel. |
CI |
Whether a 100(1-alpha)% pointwise confidence interval will be added to the survival curve. |
CB |
Whether a 100(1-alpha)% confidence band will be added to the survival curve. |
... |
Other plot arguments. |
Either CI or CB is set to be TRUE in this plot method, the object from predict.TransModel needs to have the argument CICB.st to be TRUE as well. Otherwise, no confidence interval or band will be added to the plot.
This data set is randomly generated from the proportional odds transformation model as an example.
data(PO_examp)
data(PO_examp)
A data frame containing survival time, right censoring indicator, predictors gender and age, and a trivial variable called error.
Calculate survival probabilities, confidence intervals and confidence bands in the estimated transformation model. If new time points is not specified, event times in the original data set will be used. If no new covariate values are specified, zeros will be used and the baseline survival probabilities will be calculated.
## S3 method for class 'TransModel' predict(object, ...)
## S3 method for class 'TransModel' predict(object, ...)
object |
An object returned from the function TransModel. |
... |
Other arguments including: newdata: a vector containing the values for each covariate variables specified in the model. If not specified, 0 will be used for all variables. new.time: vector of ordered time points to be used for survival probability calculation. If null, distinct event time points in the original dataset will be used. alpha: used to determine the confidence level of the predicted confidence interval/band for the survival curve. The default value is 0.05, corresponding to a 95% confidence level. |
time |
ordered time points on which survival probabilities are calculated. |
survival |
predicted survival probabilities. |
low.ci |
the lower limit of confidence interval. |
up.ci |
the upper limit of confidence interval. |
low.cb |
the lower limit of confidence band. |
up.cb |
the upper limit of confidence band. |
The values low.ci, up.ci, low.cb and up.cb will be returned only if CICB.st=TRUE in the original model.
data(PH_examp) mod1<-TransModel(formula=Surv(time,status)~gender+age,data=PH_examp,r=0) # Predict survival probability pred1<-predict(mod1,newdata=c(0,1)) pred2<-predict(mod1,newdata=c(1,1)) plot(pred1) lines(pred2$time,pred2$survival,type="s",col=2) ### Not Run ### # survival estimate with 95% pointwise CI and overall CB # mod1<-TransModel(formula=Surv(time,status)~gender+age,data=PH_examp,r=0,CICB.st=TRUE,num.sim=50) # pred1<-predict(mod1,newdata=c(0,1)) # plot(pred1,lty=1,col=1,CI=TRUE,CB=TRUE) # Change the confidence level to 90% # pred1<-predict(mod1,newdata=c(0,1),alpha=0.1)
data(PH_examp) mod1<-TransModel(formula=Surv(time,status)~gender+age,data=PH_examp,r=0) # Predict survival probability pred1<-predict(mod1,newdata=c(0,1)) pred2<-predict(mod1,newdata=c(1,1)) plot(pred1) lines(pred2$time,pred2$survival,type="s",col=2) ### Not Run ### # survival estimate with 95% pointwise CI and overall CB # mod1<-TransModel(formula=Surv(time,status)~gender+age,data=PH_examp,r=0,CICB.st=TRUE,num.sim=50) # pred1<-predict(mod1,newdata=c(0,1)) # plot(pred1,lty=1,col=1,CI=TRUE,CB=TRUE) # Change the confidence level to 90% # pred1<-predict(mod1,newdata=c(0,1),alpha=0.1)
A summary table with coefficient estimates, standard error and p-values will be printed.
## S3 method for class 'summary.TransModel' print(x, ...)
## S3 method for class 'summary.TransModel' print(x, ...)
x |
An object from the function summary.TransModel. |
... |
Other print arguments. |
Estimated coefficients and covariance matrix will be printed for the fitted linear transformation model from TransModel.
## S3 method for class 'TransModel' print(x, ...)
## S3 method for class 'TransModel' print(x, ...)
x |
An object from the function TransModel. |
... |
Other auguments to be specified for the print function. |
A summary table contains the coefficient estimates, standard errors, test statistics and p values in the linear transformation model.
## S3 method for class 'TransModel' summary(object, ...)
## S3 method for class 'TransModel' summary(object, ...)
object |
An object returned from the function TransModel. |
... |
Other auguments to be specified for the summary function. |
coefficients |
The summary table. |
data(veteran) fit<-TransModel(Surv(time,status)~karno+as.factor(celltype),data=veteran,r=0,subset=(prior==0)) summary(fit) fit0<-TransModel(Surv(time,status)~1,data=veteran,r=0,subset=(prior==0)) #the null model summary(fit0)
data(veteran) fit<-TransModel(Surv(time,status)~karno+as.factor(celltype),data=veteran,r=0,subset=(prior==0)) summary(fit) fit0<-TransModel(Surv(time,status)~1,data=veteran,r=0,subset=(prior==0)) #the null model summary(fit0)
This function is used to fit a linear transformation model, such as the proportional hazards model or proportional odds model, to the right censored survival data.
TransModel(formula = formula(data), data = parent.frame(), r, CICB.st, subset, dx, iter.max, num.sim)
TransModel(formula = formula(data), data = parent.frame(), r, CICB.st, subset, dx, iter.max, num.sim)
formula |
A survival formula based on the Surv() function, containg survival time, right censoring indicator and coavariates. |
data |
Data set with all the variables needed in formula. |
r |
Parameter in the hazard function, used to define different linear models. See details for more information. |
CICB.st |
Whether or not the perturbation for deriving the confidence intervals and confidence bands of survival estimates will be done. The default value is FALSE. |
subset |
Conditions for subsetting the dataset. |
dx |
Convergence tolerance. Default is 0.001. |
iter.max |
Maximum number of iterations before convergence. Default is 100. |
num.sim |
The number of perturbation, only works when CICB.st=TRUE. Default is 200. |
In the linear transformation model H(t)=-b'z+e, the hazard function for error term e is defined as: h(x)=exp(x)/(1+r*exp(x)), where the parameter r must be a non-negative value and can be changed for different models. For example, r=0 refers to the proportional hazards model and r=1 refers to a proportional odds model. The default value for r is 0.
coefficients |
Estimated coefficients for covariates in the specified linear transformation model. |
vcov |
Estimated covariance matix for the coefficients. |
converged |
Convergence status, 0 indicates converged, and number of iterations used for convergence. |
Kani Chen, et al., Semiparametric analysis of transformation models with censored data. Biometrika, 89(3), 659-668, 2002.
beta0 = c(1,-1) # Fit proportional hazards model data(PH_examp) mod1<-TransModel(formula=Surv(time,status)~gender+age,data=PH_examp,r=0) print(mod1) summary(mod1) mod1$coefficients mod1$vcov mod1$converged # Fit proportional odds model data(PO_examp) mod2=TransModel(Surv(time,status)~gender+age,data=PO_examp,r=1) print(mod2) summary(mod2)
beta0 = c(1,-1) # Fit proportional hazards model data(PH_examp) mod1<-TransModel(formula=Surv(time,status)~gender+age,data=PH_examp,r=0) print(mod1) summary(mod1) mod1$coefficients mod1$vcov mod1$converged # Fit proportional odds model data(PO_examp) mod2=TransModel(Surv(time,status)~gender+age,data=PO_examp,r=1) print(mod2) summary(mod2)
Default method for function TransModel.
## Default S3 method: TransModel(formula = formula(data), data = parent.frame(),r=0, CICB.st=FALSE,subset,dx=0.001,iter.max=100,num.sim=200)
## Default S3 method: TransModel(formula = formula(data), data = parent.frame(),r=0, CICB.st=FALSE,subset,dx=0.001,iter.max=100,num.sim=200)
formula |
A survival formula based on Surv function, containg survival time, right censoring indicator and coavariates. |
data |
Data set with all the variables needed in formula. |
r |
Parameter in the hazard function, used to define different transformation models. Must be a non-negative value. The default value is 0. |
CICB.st |
Whether or not the perturbation for the confidence interval and confidence bands will be done. The default value is FALSE. |
subset |
Conditions for subsetting the dataset. |
dx |
Upbound of convergence limit. Default is 0.001. |
iter.max |
Maximum number of iterations before convergence. Default is 100. |
num.sim |
The number of perturbation, only works when CICB.st=TRUE. Default is 200. |
Randomised trial of two treatment regimens for lung cancer. This is a standard survival analysis data set.
data(veteran)
data(veteran)
trt: 1=standard 2=test celltype: 1=squamous, 2=smallcell, 3=adeno, 4=large time: survival time status: censoring status karno: Karnofsky performance score (100=good) diagtime: months from diagnosis to randomisation age: in years prior: prior therapy 0=no, 1=yes
D Kalbfleisch and RL Prentice (1980), The Statistical Analysis of Failure Time Data. Wiley, New York.