Package 'TransModel'

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

Help Index


Fit Linear Transformation Models for Right Censored Data

Description

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.

Details

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.

Author(s)

Jie Zhou, Jiajia Zhang, Wenbin Lu

Maintainer: Jie Zhou <[email protected]>

References

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.


Data example for proportional hazard model.

Description

This data set is randomly generated from the proportional hazards transformation model as an example.

Usage

data(PH_examp)

Format

A data frame containing survival time, right censoring indicator, predictors gender and age, and a trivial variable called error.


Plot the predicted survival curve with confidence interval/band.

Description

Survival curve with confidence interval or confidence band will be plotted for the returned object from predict.TransModel.

Usage

## S3 method for class 'predict.TransModel'
plot(x, CI = FALSE, CB = FALSE, ...)

Arguments

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.

Note

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.


Data example for proportional odds model.

Description

This data set is randomly generated from the proportional odds transformation model as an example.

Usage

data(PO_examp)

Format

A data frame containing survival time, right censoring indicator, predictors gender and age, and a trivial variable called error.


Predict survival probabilities with confidence intervals and confidence bands

Description

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.

Usage

## S3 method for class 'TransModel'
predict(object, ...)

Arguments

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.

Value

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.

Note

The values low.ci, up.ci, low.cb and up.cb will be returned only if CICB.st=TRUE in the original model.

Examples

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)

Print method for the summary output of TransModel.

Description

A summary table with coefficient estimates, standard error and p-values will be printed.

Usage

## S3 method for class 'summary.TransModel'
print(x, ...)

Arguments

x

An object from the function summary.TransModel.

...

Other print arguments.


Print method for the function TransModel.

Description

Estimated coefficients and covariance matrix will be printed for the fitted linear transformation model from TransModel.

Usage

## S3 method for class 'TransModel'
print(x, ...)

Arguments

x

An object from the function TransModel.

...

Other auguments to be specified for the print function.


Summary results for fitting the linear transformation model

Description

A summary table contains the coefficient estimates, standard errors, test statistics and p values in the linear transformation model.

Usage

## S3 method for class 'TransModel'
summary(object, ...)

Arguments

object

An object returned from the function TransModel.

...

Other auguments to be specified for the summary function.

Value

coefficients

The summary table.

Examples

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)

Main function for fitting the linear transformation models for right censored data

Description

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.

Usage

TransModel(formula = formula(data), data = parent.frame(), r, CICB.st, subset, 
dx, iter.max, num.sim)

Arguments

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.

Details

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.

Value

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.

References

Kani Chen, et al., Semiparametric analysis of transformation models with censored data. Biometrika, 89(3), 659-668, 2002.

Examples

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.

Description

Default method for function TransModel.

Usage

## 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)

Arguments

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.


Veterans Administration Lung Cancer study

Description

Randomised trial of two treatment regimens for lung cancer. This is a standard survival analysis data set.

Usage

data(veteran)

Format

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

Source

D Kalbfleisch and RL Prentice (1980), The Statistical Analysis of Failure Time Data. Wiley, New York.