knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Algorithm 1 Estimating and Evaluating an Individualized Treatment Rule (ITR) using the Same Experimental Data via Cross-Validation
| Steps in Algorithm 1 | Function/object | Output |
|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------|:-----------------------------------|
| 1. Split data into $K$ random subsets of equal size $\left(\mathbf{Z}1, \cdots, \mathbf{Z}_k\right)$ | caret::createFolds()
within estimate_itr()
| dataframe |
| 2. k $\leftarrow$ 1 | | |
| 3. while $k \leq K$ do | for loop in fit_itr()
within estimate_itr()
| |
| 4. $\quad \mathbf{Z}{-k}=\left[\mathbf{Z}1, \cdots, \mathbf{Z}{k-1}, \mathbf{Z}{k+1}, \cdots, \mathbf{Z}_K\right]$ | trainset
object | training data |
| 5. $\hat{f}{-k}=F\left(\mathbf{Z}{-k}\right)$ | modulized functions for each ML algoritms (e.g., run_causal_forest()
) within estimate_itr()
| ITR (binary vector) |
| 6. $\hat{\tau}_k=\hat{\tau}{\hat{f}{-k}}\left(\mathbf{Z}_k\right)$ | compute_qoi()
function within evaluate_itr()
| metrics for fold $k$ |
| 7. $k \leftarrow k+1$ | | |
| 8. end while | | |
| 9.return $\hat{\tau}_F=\frac{1}{K} \sum{k=1}^K \hat{\tau}k$, $\widehat{\mathbb{V}\left(\hat{\tau}_F\right)}=v\left(\hat{f}{-1}, \cdots, \hat{f}_{-k}, \mathbf{Z}_1, \cdots, \mathbf{Z}_K\right)$ | PAPEcv()
PAPDcv()
and getAupecOutput()
functions inside compute_qoi()
function within evaluate_itr()
| averaging the results across folds |
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.