LDTFPsurvival: Survival Regression using Linear Dependent Tailfree Processes

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function generates a posterior density sample for a Linear Dependent Tailfree Process model for conditional survival estimation of time-to-event data.

Usage

1
2
3
4
5
LDTFPsurvival(y,x,xtf,prediction,prior,mcmc,
              state,status,grid=seq(0.01,60,len=100),
              compute.band=FALSE,type.band="PD",
              data=sys.frame(sys.parent()),
              na.action=na.fail,work.dir=NULL)

Arguments

y

a vector giving the response variables.

x

a matrix giving the design matrix for the median function.

xtf

a matrix giving the design matrix for the conditional probabilities.

prediction

a list giving the information used to obtain conditional inferences. The list includes the following elements: xdenpred and xtfdenpred giving the design matrices for the median and conditional probabilities, respectively, used to obtain inferences about the conditional densities and survival functions, xmedpred and xtfmedpred giving the design matrices for the median and conditional probabilities, respectively, used to obtain inferences about quantiles, and quans a double precision vector giving THREE quantiles for which inferences are obtained. If quans is not specified, the default is quans=c(0.03,0.50,0.97).

prior

a list giving the prior information. The list includes the following parameter: maxn an integer giving the truncation of the tailfree process, a0 and b0 giving the hyperparameters for prior distribution of the precision parameter of the linear dependent tailfree prior, alpha giving the value of the precision parameter (it must be specified if a0 is missing), mub giving the mean of the normal prior of the median regression coefficients, Sb giving the (co)variance of the normal prior distribution for the median regression coefficents, and tau1 and tau2 giving th hyperparameters of the inv-gamma distribution for the centering variance.

mcmc

a list giving the MCMC parameters. The list must include the following elements: nburn an integer giving the number of burn-in scans, nskip an integer giving the thinning interval, nsave an integer giving the total number of scans to be saved, ndisplay an integer giving the number of saved scans to be displayed on screen (the function reports on the screen when every ndisplay iterations have been carried out).

state

a list giving the current value of the parameters. This list is used if the current analysis is the continuation of a previous analysis.

status

a logical variable indicating whether this run is new (TRUE) or the continuation of a previous analysis (FALSE). In the latter case the current value of the parameters must be specified in the object state.

grid

vector of grid points where the conditional survival functions are evaluated. The default value is NULL and the grid is chosen according to the range of the data.

compute.band

logical variable indicating whether the credible band for the conditional density and mean function must be computed.

type.band

string indication the type of credible band to be computed; if equal to "HPD" or "PD" then the 95 percent pointwise HPD or PD band is computed, respectively.

data

data frame.

na.action

a function that indicates what should happen when the data contain NAs. The default action (na.fail) causes LDTFPsurvival to print an error message and terminate if there are any incomplete observations.

work.dir

working directory.

Details

This generic function fits a Linear Dependent Tailfree process (Jara and Hanson, 2011), for (potentially) interval-censored data. Let T_i in R+ be the time-to-event for subject i and set z_i = log T_i. The model for the log time-to.event data is given by:

zi = xi' beta + vi, i=1,…,n

vi | Gxtfi ~ Gxtfi

{Gxtf: xtf in X} | maxm, alpha, sigma2 ~ LDTFP^maxm(h,Pi^{sigma2},\textit{A}^{alpha,rhi})

where, h is the logistic CDF, and Gxtf is median-zero and centered around an N(0,sigma2) distribution. To complete the model specification, independent hyperpriors are assumed,

alpha | a0, b0 ~ Gamma(a0,b0)

sigma^-2 | tau1, tau2 ~ Gamma(tau1/2,tau2/2)

The precision parameter, alpha, of the LDTFP prior can be considered as random, having a gamma distribution, Gamma(a0,b0), or fixed at some particular value. To let alpha to be fixed at a particular value, set a0 to NULL in the prior specification.

The computational implementation of the model is based on Slice sampling (Neal, 2003).

Value

An object of class LDTFPsurvival representing the LDTFP model fit. Generic functions such as print, plot, and summary have methods to show the results of the fit. The results include beta, alpha and sigma^2.

The list state in the output object contains the current value of the parameters necessary to restart the analysis. If you want to specify different starting values to run multiple chains set status=TRUE and create the list state based on this starting values. In this case the list state must include the following objects:

alpha

a double precision giving the value of the precision parameter.

betace

a vector giving the value of the median regression coefficient.

sigma^2

a double precision giving the value of the centering variance.

betatf

a matrix giving the regression coefficients for each conditional probability.

z

a vector giving the current value of the (imputed) survival times.

Author(s)

Alejandro Jara <atjara@uc.cl>

References

Jara, A., Hanson, T. (2011). A class of mixtures of dependent tail-free processes. Biometrika, 98(3): 553 - 566.

Neal, R. (2003) Slice sampling. Anals of Statistics, 31: 705 - 767.

See Also

LDTFPdensity,LDDPsurvival

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
## Not run: 

   #############################################################
   # Time to Cosmetic Deterioration of Breast Cancer Patients
   #############################################################

     data(deterioration)
     attach(deterioration)
     y <- cbind(left,right)
      
   # Design matrix

     x <- cbind(rep(1,length(trt)),trt)
     xtf <- cbind(rep(1,length(trt)),trt)
     colnames(x) <- c("(Intercept)","trt")
     colnames(xtf) <- c("(Intercept)","trt")
      
   # Prediction

     xdenpred <- cbind(rep(1,2),c(0,1))
     xtfdenpred <- cbind(rep(1,2),c(0,1))
     xmedpred <- cbind(rep(1,2),c(0,1))
     xtfmedpred <- cbind(rep(1,2),c(0,1))

     prediction <- list(xdenpred=xdenpred,
                        xtfdenpred=xtfdenpred,
                        xmedpred=xmedpred,
                        xtfmedpred=xtfmedpred,
                        quans=c(0.03,0.50,0.97))

   # Prior information

     prior <- list(maxm=5,
                   a0=1,
                   b0=1,
                   mub=rep(0,2),
                   Sb=diag(1000,2),
                   tau1=2,002,
                   tau2=2.002)

   # Initial state
     state <- NULL

   # MCMC parameters

     mcmc <- list(nburn=5000,
                  nsave=5000,
                  nskip=4,
                  ndisplay=200)

   # Fitting the model
 
     fit1 <- LDTFPsurvival(y=y,
                           x=x,
                           xtf=xtf,
                           prediction=prediction,
                           prior=prior, 
                           mcmc=mcmc,     
                           state=state,
                           grid=seq(0.01,70,len=200),
                           status=TRUE,
                           compute.band=TRUE)

     fit1
     summary(fit1)
     plot(fit1)

   # Plotting survival functions estimates
 
     par(cex=1.7,mar=c(4.1, 4.1, 1, 1))
     x1 <- fit1$grid
     y1 <- fit1$survml[1,]
     x2 <- fit1$grid
     y2 <- fit1$survmu[1,]
     aa <- rbind(x2,y2)[, order(-x2, y2)]
     x2 <- aa[1,]
     y2 <- aa[2,]
     plot(fit1$grid,fit1$survmu[1,],type="l",
          xlab="months",ylab="survival",
          lty=1,lwd=2,ylim=c(0,1),col="lightgray")
     polygon(x=c(x1,x2),y=c(y1,y2),border=NA,col="lightgray")
     lines(fit1$grid,fit1$survmm[1,],lty=1,lwd=3)

     par(cex=1.7,mar=c(4.1, 4.1, 1, 1))
     x1 <- fit1$grid
     y1 <- fit1$survml[2,] 
     x2 <- fit1$grid
     y2 <- fit1$survmu[2,]
     aa <- rbind(x2,y2)[, order(-x2, y2)]
     x2 <- aa[1,]
     y2 <- aa[2,]
     plot(fit1$grid,fit1$survmu[2,],type="l",
          xlab="months",ylab="survival",
          lty=1,lwd=2,ylim=c(0,1),col="lightgray")
     polygon(x=c(x1,x2),y=c(y1,y2),border=NA,col="lightgray")
     lines(fit1$grid,fit1$survmm[2,],lty=1,lwd=3)

## End(Not run)

DPpackage documentation built on May 1, 2019, 10:23 p.m.