Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates a posterior density sample of the Survival curve from a semiparametric AFT regression model for interval-censored data.
1 2 |
object |
|
grid |
a vector of grid points where the survival curve should be evaluated. |
xnew |
an optional matrix containing the value of the covariables with which to predict. If omitted, the baseline survival information is calculated. |
hpd |
a logical variable indicating whether a 95HPD interval is
calculated, |
... |
further arguments to be passed. |
This function computes the survival curve based on the fit of a Mixture of Dirichlet process in a AFT regression model for interval censored data (Hanson and Johnson, 2004).
Given a MCMC sample of size J of the parameters, a sample of the predictive survival curve for X is drawn as follows: for the MCMC scan j of the posterior distribution, with j=1,...,J, we sample from:
S^{(j)}(t|X,data) ~ Beta(a^{(j)}(t),b^{(j)}(t))
where,
a^{(j)}(t)=α^{(j)} G_0^{(j)}( (t \exp(X β^{(j)}) , ∞) ) + ∑_{i=1}^n δ_{V^{(j)}_i} ( (t \exp(X β^{(j)}) , ∞) )
and
b^{(j)}(t)=α^{(j)}+N - a^{(j)}(t)
An object of class predict.DPsurvint
representing the survival information
arising from a DPsurvint
model fit. The results include the posterior mean (pmean
),
the posterior median (pmedian
), the posterior standard deviation (psd
),
the naive standard error (pstd
) and the limits of the HPD or credibility intervals,
plinf
and plsup
.
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.
Hanson, T., and Johnson, W. (2004) A Bayesian Semiparametric AFT Model for Interval-Censored Data. Journal of Computational and Graphical Statistics, 13: 341-361.
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 | ## 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<-5000
nsave<-10000
nskip<-10
ndisplay<-50
mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,
ndisplay=ndisplay,tune=0.125)
# Prior information
prior <- list(alpha=10,beta0=rep(0,2),Sbeta0=diag(100000,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
plot(fit1)
plot(fit1,nfigr=2,nfigc=2)
# Plot an specific model parameter
plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="x1")
plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="mu")
# Predictive information for baseline survival
grid<-seq(0.00001,14,0.5)
pred<-predict(fit1,grid=grid)
# Plot Baseline information with and without Credibility band
plot(pred)
plot(pred,band=TRUE)
# 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)
pred<-predict(fit1,xnew=xnew,grid=grid)
# Plot Baseline information
plot(pred,band=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.