aftprobiths: Horseshoe shrinkage prior in integrated survival and binary...

Description Usage Arguments Value References Examples

View source: R/aftprobiths.R

Description

This function provides the implementation of integrated survival and binary high dimensiona regression utilizing Horseshoe prior on the paramters

Usage

1
2
aftprobiths(ct, z, X, burn = 1000, nmc = 5000, thin = 1,
  alpha = 0.05, Xtest = NULL, cttest = NULL, ztest = NULL)

Arguments

ct

survival response, a n*2 matrix with first column as response and second column as right censored indicator, 1 is event time and 0 is right censored.

z

binary response, a n*1 vector with numeric values 0 or 1.

X

Matrix of covariates, dimension n*p.

burn

Number of burn-in MCMC samples. Default is 1000.

nmc

Number of posterior draws to be saved. Default is 5000.

thin

Thinning parameter of the chain. Default is 1 (no thinning).

alpha

Level for the credible intervals. For example, alpha = 0.05 results in 95% credible intervals.

Xtest

test design matrix.

cttest

test survival response.

ztest

test binary response.

Value

Beta.sHat

Posterior mean of β for survival model, a p by 1 vector.

Beta.bHat

Posterior mean of β for binary model, a p by 1 vector.

LeftCI.s

The left bounds of the credible intervals for Beta.sHat.

RightCI.s

The right bounds of the credible intervals for Beta.sHat.

LeftCI.b

The left bounds of the credible intervals for Beta.bHat.

RightCI.b

The right bounds of the credible intervals for Beta.bHat.

Beta.sMedian

Posterior median of beta for survival model, a p by 1 vector.

Beta.bMedian

Posterior median of beta for binary model, a p by 1 vector.

SigmaHat

Posterior mean of variance covariance matrix.

LambdaHat

Posterior mean of λ, a p*1 vector.

TauHat

Posterior mean of τ, a 2*1 vector.

Beta.sSamples

Posterior samples of β for survival model.

Beta.bSamples

Posterior samples of β for binary model.

LambdaSamples

Posterior samples of λ.

TauSamples

Posterior samples of τ.

SigmaSamples

Posterior samples of variance covariance matrix.

DIC.s

DIC for survival model.

DIC.b

DIC for binary model.

SurvivalHat

Predictive survival probability.

LogTimeHat

Predictive log time.

References

Maity, A. K., Carroll, R. J., and Mallick, B. K. (2019) "Integration of Survival and Binary Data for Variable Selection and Prediction: A Bayesian Approach", Journal of the Royal Statistical Society: Series C (Applied Statistics).

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
burnin <- 50
nmc    <- 150
thin <- 1
y.sd   <- 1  # standard deviation of the response

p <- 100  # number of predictors
ntrain <- 100  # training size
ntest  <- 50   # test size
n <- ntest + ntrain  # sample size
q <- 10   # number of true predictos

beta.t <- c(sample(x = c(1, -1), size = q, replace = TRUE), rep(0, p - q))  # randomly assign sign

Sigma <- matrix(0.9, nrow = p, ncol = p)
for(j in 1:p)
{
Sigma[j, j] <- 1
}

x <- mvtnorm::rmvnorm(n, mean = rep(0, p), sigma = Sigma)    # correlated design matrix

zmean <- x %*% beta.t
tmean <- x %*% beta.t
yCorr <- 0.5
yCov <- matrix(c(1, yCorr, yCorr, 1), nrow = 2)


y <- mvtnorm::rmvnorm(n, sigma = yCov)
t <- y[, 1] + tmean
z <- ifelse((y[, 2] + zmean) > 0, 1, 0)
X <- scale(as.matrix(x))  # standarization

z <- as.numeric(as.matrix(c(z)))
t <- as.numeric(as.matrix(c(t)))
T <- exp(t)   # AFT model
C <- rgamma(n, shape = 1.75, scale = 3)   # 42% censoring time
time <- pmin(T, C)  # observed time is min of censored and true
status = time == T   # set to 1 if event is observed
ct <- as.matrix(cbind(time = time, status = status))  # censored time


# Training set
ztrain <- z[1:ntrain]
cttrain <- ct[1:ntrain, ]
Xtrain  <- X[1:ntrain, ]

# Test set
ztest <- z[(ntrain + 1):n]
cttest <- ct[(ntrain + 1):n, ]
Xtest  <- X[(ntrain + 1):n, ]

posterior.fit.joint <- aftprobiths(ct = cttrain, z = ztrain, X = Xtrain,
                                   burn = burnin, nmc = nmc, thin = thin,
                                   Xtest = Xtest, cttest = cttest, ztest = ztest)
                             
posterior.fit.joint$Beta.sHat

intsurvbin documentation built on Oct. 3, 2019, 9:02 a.m.