main effects as well as linear or non-linear interactions. If we observe Equations \[chap3:pencomp\] and \[chap3:pencomp2\], we can see that these two equations are constructed using a non-linear spline specification on the propensity of assigned treatment combined with possible linear interactions between the propensity of assigned treatment and remaining covariates. This fits well with the type of estimation problems that BART was designed to solve. We then use the model produced by BART-modified PENCOMP to compute the counterfactual of $Y_{z_1^{(b)}}^{(b)}$ for bootstrap sample $b$.

5.  Estimate the distribution for $S_{z_1^{(b)}}^{(b)}|Z_1^{(b)}=z_1^{(b)},Y_{z_1^{(b)}}^{(b)},X_{z_1^{(b)}}^{(b)},W_1^{(b)},V^{(b)}$ at $t=2$. Use this model to generate a survival status for the counterfactual of $S_{z_1^b}^{(b)}$ taking into account the assumption of monotonicity in Equation (\[monotonicity\]) i.e. if $S_0$ is observed and $S_0=0$ then $S_1=0$. Similarly, if $S_1$ is observed and $S_1=1$ then $S_0=1$.

6.  Estimate the model $X_{z_1^{(b)},z_2^{(b)}}^{(b)}|Z_1^{(b)}=z_1^{(b)},Z_2^{(b)}=z_2^{(b)},Y_{z_1^{(b)}}^{(b)},X_{z_1^{(b)}}^{(b)},W_1^{(b)},W_2^{(b)},V^{(b)}$. Use the respective models to impute the counterfactual of $X_{z_1^{(b)},z_2^{(b)}}^{(b)}$, using any previously imputed values for the unobserved treatment regimes and restricting to the subjects that are observed and predicted to survive under the given treatment regimen of interest at $t=1$.

7.  Estimate the distribution of $Z_2^{(b)}|Z_1^{(b)}=z_1^{(b)},Y_{z_1^{(b)}}^{(b)},X_{z_1^{(b)}}^{(b)},W_1^{(b)},W_2^{(b)},V^{(b)}$. Use this model to estimate the propensity to be assigned treatment $Z_2^{(b)}=z_2^{(b)}$ as $P_{z_2^{(b)}}=Pr(Z_1^{(b)}=z_1^{(b)}|X_{z_1^{(b)}}^{(b)},Z_1^{(b)}=z_1^{(b)},W_1^{(b)},V^{(b)})$. The 