bayesian_boot_irrd provides the bootstrap sample for individual risk difference and risk ratio, it can be used for further inferences.
bayesian_boot_irrd(dat2,B,sigma_2_0, EM_initial, varlist, t1_star,t)The dataset, includes non-terminal events, terminal events as well as event indicator.
Number of bootstraps that the user want to run, typically we use B = 500.
Initial value for sigma_2 for the general Markov model
Initial value for the EM algorithm, the output of OUT_em_weights.
Confounder list for the propensity score model.
Fixed non-terminal event time for estimating risk difference/ratio for terminal event following the non-terminal event.
Fixed time point of interest to compare the individual risk difference / ratio.
A n times B matrix as the Bayesian bootstrap sample for each data point. The sample is for individual risk difference for time to non-terminal event at time t.
A n times B matrix as the Bayesian bootstrap sample for each data point. The sample is for individual risk difference for time to terminal event without non-terminal event at time t.
A n times B matrix as the Bayesian bootstrap sample for each data point. The sample is for individual risk difference for time to terminal event following non-terminal event by t1_start at time t.
A n times B matrix as the Bayesian bootstrap sample for each data point. The sample is for individual risk ratio for time to non-terminal event at time t.
A n times B matrix as the Bayesian bootstrap sample for each data point. The sample is for individual risk ratio for time to terminal event without non-terminal event at time t.
A n times B matrix as the Bayesian bootstrap sample for each data point. The sample is for individual risk ratio for time to terminal event following non-terminal event by t1_start at time t.
For each bootstrap sample:
1. Generate \(n\) standard exponential (mean and variance 1) random variates : \(u_1, u_2,..., u_n\);
2. The weights for the Bayesian bootstrap are: \(w_{i}^{boot} = u_i / \bar{u}\), where \(\bar{u} = n^{-1}\sum_{i=1}^{n} u_i\);
3. Calculate the propensity score and IP weights \(w_{i}^{IPW}\) based on Bayesian bootstrap weighted data, and assigned the weights for fitting the MSM general Markov model as \(w_i = w_{i}^{boot} * w_{i}^{IPW}\).
4. After obtaining \(\hat{\theta}\) and \(\hat{b}_i\), for each individual i, calculate the IRR and IRD by plugging \(\hat{\theta}, \hat{b}_i\) and a=0, a=1 separately at time t.
The 95% prediction intervals (PI) cam be obtained by the normal approximation using bootstrap standard error.