Description Usage Arguments Value References Examples
Performs Bayesian Variable Selection on the covariates in a semi-competing risks model
1 2 | SCRSELECT(Y1, I1, Y2, I2, X, hyperparameters, beta1start, beta2start,
beta3start, B, inc, Path, burn)
|
Y1 |
Vector Containing non-terminal event times (or censoring time due to death/censoring) |
I1 |
Vector Containing non-terminal event indicators (1 if non-terminal event for a patient, 0 otherwise) |
Y2 |
Vector Containing Terminal Event times (or censoring) |
I2 |
Vector Containing Terminal event indicators (1 if a patients experiences a non-ternminal event, 0 if censored) |
X |
Matrix of Patient Covariates. The last inc will be left out of variable selection. |
hyperparameters |
List containing 29 hyperparameters and four starting values. In order they are: psi-the swap rate of the SVSS algorithm. c-parameter involved in Sigma matrix for selection. z1a, z1b, z2a, z2b, z3a, z3b - beta hyper parameters on probability of inclusion for each of the three hazard functions. a1,b1,a2,b2,a3,b3- hyperparameters on sigma_lambda_1, sigma_lambda_2, and sigma_lambda_3. clam1, clam2, clam3 - spatial dependency of baseline hazard (between 0 and 1) for the three hazard functions. Alpha1, Alpha2, Alpha3 - The parameter for the number of split points in hazards 1,2 and 3 (must be whole number). J1max, J2max, J3max - Maximum number of split points allowed (must be whole number). J1, J2, J3- Starting number of split points. w, psi1- hyperparameters on theta^-1. cep=Tuning Parameter for theta^-1 sampler. epstart-Starting value for theta^-1. cl1,cl2,cl3-Tuning parameters for log baseline hazard height sampler. |
beta1start |
Starting Values for Beta1 |
beta2start |
Starting Values for Beta2 |
beta3start |
Starting Values for Beta3 |
B |
Number of iterations |
inc |
Number of variables left out of selection |
Path |
Where to save posterior samples |
burn |
percent of posterior sample to burn in (burn*B must be a whole number) |
Returns marginal posterior probability of inclusion (post burn-in) for each hazard function along with acceptance rates for the various Metropolis-Hastings (and Metropolis-Hastings-Green) samplers.
[1] Lee, K. H., Haneuse, S., Schrag, D. and Dominici, F. (2015), Bayesian semi-parametric analysis of semi-competing risks data: investigating hospital readmission after a pancreatic cancer diagnosis. Journal of the Royal Statistical Society: Series C (Applied Statistics), 64: 253-273. doi: 10.1111/rssc.12078 [2] Chapple, A.C., Vannucci, M., Thall, P.F., Lin, S.(2017), Bayesian Variable selection for a semi-competing risks model with three hazard functions. Journal of Computational Statistics & Data Analysis, Volume 112, August 2017, Pages 170-185 [3] https://adventuresinstatistics.wordpress.com/2017/04/10/package-scrselect-using-returnmodel/
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 | ####Randomly Generate Semicompeting Risks Data
set.seed(1)
####Generates random patient time, indicator and covariates.
n=100
Y1=runif(n,0,100)
I1=rbinom(n,1,.5)
Y2=Y1
I2=I1
for(i in 1:n){if(I1[i]==0){Y2[i]=Y1[i]}else{Y2[i]=Y1[i]+runif(1,0,100)}}
I2=rbinom(n,1,.5)
library(mvtnorm)
X=rmvnorm(n,rep(0,7),diag(7))
####Read in Hyperparameters
##Swap Rate
psi=.5
c=5
###Eta Beta function probabilities
z1a=.4
z1b=1.6
z2a=.4
z2b=1.6
z3a=.4
z3b=1.6
####Hierarchical lam params
###Sigma^2 lambda_g hyperparameters
a1=.7
b1=.7
a2=a1
b2=b1
a3=a1
b3=b1
##Spacing dependence c in [0,1]
clam1=1
clam2=1
clam3=1
#####NumSplit
alpha1=3
alpha2=3
alpha3=3
J1max=10
J2max=10
J3max=10
####Split Point Starting Value ###
J1=3
J2=3
J3=3
###epsilon starting values/hyperparameters###
w=.7
psi1=.7
cep=2.4
#############
epstart=1.5
cl1=.25
cl2=.25
cl3=.25
###Beta Starting Values
beta1start=c(1,1,1,1,1,-1,-1)
beta2start=c(1,1,1,1,1,-1,-1)
beta3start=c(-1,1,1,1,1,-1,-1)
hyper1=c(psi,c,z1a,z1b,z2a,z2b,z3a,z3b,a1,b1,a2,b2,a3,b3,clam1,clam2,clam3)
hyper2=c(alpha1,alpha2,alpha3,J1max,J2max,J3max,J1,J2,J3,w,psi1,cep,epstart,cl1,cl2,cl3)
hyper=c(hyper1,hyper2)
###Number of iterations and output location
B=100
Path=tempdir()
###Number of variables to exclude from selection and burnin percent
inc=2
burn=.1
SCRSELECT(Y1,I1,Y2,I2,X,hyper,beta1start,beta2start,beta3start,B,inc,Path,burn)
|
Loading required package: mvtnorm
More than One Variable Included
Posterior Inclusion Probabilities after half Burnin
Hazard 1
44.44444 62.22222 32.22222 71.11111 43.33333
Hazard 2
72.22222 65.55556 56.66667 57.77778 11.11111
Hazard 3
35.55556 55.55556 53.33333 25.55556 26.66667
IndEta 25.55556 20 36.66667
IndMix 3.333333 6.666667 22.22222
Included Acceptance
Haz1
14.44444 31.11111
27.5 28.57143 37.93103 28.125 51.28205
Haz2
43.33333 35.55556
26.15385 18.64407 52.94118 21.15385 30
Haz3 35.55556 27.77778
27.5 28.57143 37.93103 28.125 51.28205
Survival
IndDeath 5.555556 7.777778 6.666667
IndBirth 5.555556 10 6.666667
Lambda
Lam1 77.77778 87.77778 85.55556 90.14085 91.66667 NaN NaN NaN NaN NaN NaN
Lam2 72.22222 68.88889 92.40506 100 100 NaN NaN NaN NaN NaN NaN
Lam3 66.66667 90 NaN NaN NaN NaN NaN NaN NaN NaN NaN
Indepsilon 35.55556
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.