Learn R Programming

semicmprskcoxmsm (version 0.2.0)

bayesian_boot_irrd: Obtaining Bayesian Bootstrap Sample for Individual Risk Difference and Risk Ratio.

Description

bayesian_boot_irrd provides the bootstrap sample for individual risk difference and risk ratio, it can be used for further inferences.

Usage

bayesian_boot_irrd(dat2,B,sigma_2_0, EM_initial, varlist, t1_star,t)

Arguments

dat2

The dataset, includes non-terminal events, terminal events as well as event indicator.

B

Number of bootstraps that the user want to run, typically we use B = 500.

sigma_2_0

Initial value for sigma_2 for the general Markov model

EM_initial

Initial value for the EM algorithm, the output of OUT_em_weights.

varlist

Confounder list for the propensity score model.

t1_star

Fixed non-terminal event time for estimating risk difference/ratio for terminal event following the non-terminal event.

t

Fixed time point of interest to compare the individual risk difference / ratio.

Value

RD1_boot

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.

RD2_boot

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.

RD3_boot

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.

RR1_boot

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.

RR2_boot

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.

RR3_boot

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.

Details

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.