Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates a posterior density sample from a semiparametric AFT regression model for interval-censored data.
1 2 |
formula |
a two-sided linear formula object describing the
model fit, with the response on the
left of a |
prior |
a list giving the prior information. The list includes the following
parameter: |
mcmc |
a list giving the MCMC parameters. The list must include
the following integers: |
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 ( |
data |
data frame. |
na.action |
a function that indicates what should happen when the data
contain |
This generic function fits a Mixture of Dirichlet process in a AFT regression model for interval censored data (Hanson and Johnson, 2004):
Ti = exp(- Xi beta) Vi, i=1,…,n
β | beta0, Sbeta0 ~ N(beta0,Sbeta0)
Vi | G ~ G
G | alpha, G0 ~ DP(alpha G0)
where, G0 = Log Normal(V| mu, sigma). To complete the model specification, independent hyperpriors are assumed,
alpha | a0, b0 ~ Gamma(a0,b0)
mu | m0, s0 ~ N(m0,s0)
sigma^-1 | tau1, tau2 ~ Gamma(tau1/2,tau2/2)
The precision or total mass parameter, alpha, of the DP
prior
can be considered as random, having a gamma
distribution, Gamma(a0,b0),
or fixed at some particular value. When alpha is random the method described by
Escobar and West (1995) is used. To let alpha to be fixed at a particular
value, set a0 to NULL in the prior specification.
In the computational implementation of the model, G is considered as latent data and sampled partially with sufficient accuracy to be able to generate V1,…,Vn+1 which are exactly iid G, as proposed by Doss (1994). Both Ferguson's definition of DP and the Sethuraman-Tiwari (1982) representation of the process are used, as described in Hanson and Johnson (2004) to allow the inclusion of covariates.
A Metropolis-Hastings step is used to sample the fully conditional distribution of the regression coefficients and errors (see, Hanson and Johnson, 2004). An extra step which moves the clusters in such a way that the posterior distribution is still a stationary distribution, is performed in order to improve the rate of mixing.
An object of class DPsurvint
representing the semiparametric AFT regression
model fit. Generic functions such as print
, plot
,
summary
, and anova
have methods to show the results of the fit.
The results include beta
, mu
, sigma
, the precision
parameter alpha
, and the number of clusters.
The function predict.DPsurvint
can be used to extract posterior
information of the survival curve.
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:
beta |
giving the value of the regression coefficients. |
v |
giving the value of the errors (it must be consistent with the data. |
mu |
giving the mean of the lognormal baseline distribution. |
sigma |
giving the variance of the lognormal baseline distribution. |
alpha |
giving the value of the precision parameter. |
Alejandro Jara <atjara@uc.cl>
Doss, H. (1994). Bayesian nonparametric estimation for incomplete data using mixtures of Dirichlet priors. The Annals of Statistics, 22: 1763 - 1786.
Escobar, M.D. and West, M. (1995) Bayesian Density Estimation and Inference Using Mixtures. Journal of the American Statistical Association, 90: 577-588.
Hanson, T., and Johnson, W. (2004) A Bayesian Semiparametric AFT Model for Interval-Censored Data. Journal of Computational and Graphical Statistics, 13: 341-361.
Sethuraman, J., and Tiwari, R. C. (1982) Convergence of Dirichlet Measures and the Interpretation of their Parameter, in Statistical Decision Theory and Related Topics III (vol. 2), eds. S. S. Gupta and J. O. Berger, New York: Academic Press, pp. 305 - 315.
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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | ## Not run:
####################################
# A simulated Data Set
####################################
ind<-rbinom(100,1,0.5)
vsim<-ind*rnorm(100,1,0.25)+(1-ind)*rnorm(100,3,0.25)
x1<-rep(c(0,1),50)
x2<-rnorm(100,0,1)
etasim<-x1+-1*x2
time<-vsim*exp(-etasim)
y<-matrix(-999,nrow=100,ncol=2)
for(i in 1:100){
for(j in 1:15){
if((j-1)<time[i] & time[i]<=j){
y[i,1]<-j-1
y[i,2]<-j
}
}
if(time[i]>15)y[i,1]<-15
}
# Initial state
state <- NULL
# MCMC parameters
nburn<-20000
nsave<-10000
nskip<-10
ndisplay<-100
mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,
ndisplay=ndisplay,tune=0.125)
# Prior information
prior <- list(alpha=1,beta0=rep(0,2),Sbeta0=diag(1000,2),
m0=0,s0=1,tau1=0.01,tau2=0.01)
# Fit the model
fit1 <- DPsurvint(y~x1+x2,prior=prior,mcmc=mcmc,
state=state,status=TRUE)
fit1
# Summary with HPD and Credibility intervals
summary(fit1)
summary(fit1,hpd=FALSE)
# Plot model parameters
# (to see the plots gradually set ask=TRUE)
plot(fit1,ask=FALSE)
plot(fit1,ask=FALSE,nfigr=2,nfigc=2)
# Plot an specific model parameter
# (to see the plots gradually set ask=TRUE)
plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="x1")
plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="mu")
# Table of Pseudo Contour Probabilities
anova(fit1)
# Predictive information with covariates
npred<-10
xnew<-cbind(rep(1,npred),seq(-1.5,1.5,length=npred))
xnew<-rbind(xnew,cbind(rep(0,npred),seq(-1.5,1.5,length=npred)))
grid<-seq(0.00001,14,0.5)
pred1<-predict(fit1,xnew=xnew,grid=grid)
# Plot Baseline information
plot(pred1,all=FALSE,band=TRUE)
#############################################################
# Time to Cosmetic Deterioration of Breast Cancer Patients
#############################################################
data(deterioration)
attach(deterioration)
y<-cbind(left,right)
# Initial state
state <- NULL
# MCMC parameters
nburn<-20000
nsave<-10000
nskip<-20
ndisplay<-1000
mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,
ndisplay=ndisplay,tune=0.25)
# Prior information
prior <- list(alpha=10,beta0=rep(0,1),Sbeta0=diag(100,1),
m0=0,s0=1,tau1=0.01,tau2=0.01)
# Fitting the model
fit2 <- DPsurvint(y~trt,prior=prior,mcmc=mcmc,
state=state,status=TRUE)
fit2
# Summary with HPD and Credibility intervals
summary(fit2)
summary(fit2,hpd=FALSE)
# Plot model parameters
# (to see the plots gradually set ask=TRUE)
plot(fit2)
# Table of Pseudo Contour Probabilities
anova(fit2)
# Predictive information with covariates
xnew<-matrix(c(0,1),nrow=2,ncol=1)
grid<-seq(0.01,70,1)
pred2<-predict(fit2,xnew=xnew,grid=grid)
plot(pred2,all=FALSE,band=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.