*VT* method (Jared Foster and al, 2011) has been created to find subgroup of patients with enhanced treatment effect, if it exists. Theorically, this method can be used for binary and continous outcome. This package only deals with binary outcome in a two arms clinical trial.
*VT* method is based on random forests and regression/classification trees.
I decided to use a simulated dataset called *sepsis* in order to show how *aVT* package can be used. Type `?sepsis` to know more about this dataset. Anyway, the true subgroup is `PRAPACHE <= 26 & AGE <= 49.80`.
**NOTE:** This true subgroup is defined with the *lower* event rate (`survival = 1`) in treatement arm. Therefore in following examples we'll search the subgroup with the *highest* event rate, and we know it is
* Use regression tree to explain $Z$ by covariables $X$. Then subjects with predicted $Z_i$ greater than some threshold $c$ are considered to define a subgroup.
* Use classification tree on new variable $Z^{*}$ defined by $Z^{*}_i=1$ if $Z_i > c$ and $Z^{*}_i=0$ otherwise.
The idea is to identify which covariable from $X$ described variation of $Z$.
*Sepsis* contains simulated data on 470 subjects with a binary outcome survival, that stores survival status for patient after 28 days of treatment, value of 1 for subjects who died after 28 days and 0 otherwise. There are 11 covariates, listed below, all of which are numerical variables.
Note that contrary to the original dataset used in SIDES, missing values have been imputed by random forest `randomForest::rfImpute()`. See file *data-raw/sepsis.R* for more details.
True subgroup is `PRAPACHE <= 26 & AGE <= 49.80`. __NOTE:__ This subgroup is defined with the *lower* event rate (survival = 1) in treatement arm.
470 patients and 13 variables:
* `survival` : binary outcome
* `THERAPY` : 1 for active treatment, 0 for control treatment
* `TIMFIRST` : Time from first sepsis-organ fail to start drug
* `AGE` : Patient age in years
* `BLLPLAT` : Baseline local platelets
* `blSOFA` : Sum of baselin sofa (cardiovascular, hematology, hepaticrenal, and respiration scores)
* `BLLCREAT` : Base creatinine
* `ORGANNUM` : Number of baseline organ failures
* `PRAPACHE` : Pre-infusion apache-ii score
* `BLGCS` : Base GLASGOW coma scale score
* `BLIL6` : Baseline serum IL-6 concentration
* `BLADL` : Baseline activity of daily living score
1 will be the favorable outcome because 1 is the second level of `"survival"` column. It means that $P(Y=1)$ is the probability of interest. Anyway, it's still possible to compute $P(Y=0)$.
__Quick example__
*Sepsis* does not have any categorical variable, following example show how `vt.data` deals with categorical values depending on `interactions` parameter
`cforest()` can be usefull however computing time is really long. I think there is an issue when giving *cforest object* in Reference Class parameter. Need to fix it.
__NOTE:__ use `trt` parameter in `VT.object::getX()` or `VT.object::getY()` methods to obtain part of data depending on treatment. See following example.
Follow the same structure for `caret` or `cforest` models.
## K Fold Random Forest
This idea is taken from *method 3* of Jared Foster paper :
> A modification of [previous methods] is to obtain $\hat{P_{1i}}$ and $\hat{P_{0i}}$ via cross-validation. In this méthod the specific data for subject $i$ is not used to obtain $\hat{P_{1i}}$ and $\hat{P_{0i}}$. Using k-fold cross-validation, we apply random forest regression approach to $\frac{k-1}{k}$ of the data and use the resulting predictor to obtain estimates of $P_{1i}$ and $P_{0i}$ for the remaining $\frac{1}{k}$ of the observations. This is repeated $k$ times.
* `ratio` : Control of sampsize balance. `ratio` of $2$ means that there 2 times le highest level compared to the other. "Highest" means the level with larger observations. It's in test.
* `interactions` : Logical. If `TRUE`, interactions between covariables and treatments are used. `FALSE` otherwise.
Random Forests are not the only models you can use to compute $\hat{P_{1i}}$ and $\hat{P_{0i}}$. Any prediction model can be used, as logitic regression, boosting ...
Anyway, aVirtualTwins package can be used. To do so, you can use `VT.difft()` class. It is important to note this the parent class of all "forests" classes. It takes in argument :
* `vt.object` : return of `vt.data()` function
* `twin1` : estimate of $P(Y_{i} = 1 | T = T_{i})$ : meaning response probability under the correct treatment.
__NOTE: Also, you can clone repository, write your own child class of `VT.difft()` AND submit it !__
------------
# Step 2 : Estimate a Regression or Classification Tree
As described in the method, we define $Z_i = \hat{P_{1i}} - \hat{P_{0i}}$. It's the difference in term of response of the active treatments compared to the control treatment. The idea is to try to explain this difference by few covariables.
## Classification
We define a new variable $Z^{*}$, $Z^{*}_i=1$ if $Z_i > c$ and $Z^{*}_i=0$ otherwise. Classification tree's goal is to explain the value $Z^*=1$.
$c$ is a threshold given by the user. It's the threshold for which the difference is "interesting". One idea is to use quantiles of the *difft* distribution.
Use regression tree to explain $Z$ by covariables $X$. Then some leafs have predicted $Z_i$ greater than the threshold $c$ (if $sens$ is ">"), and it defines which covariables explain $Z$.
Once trees have been computed, you surely want to see what are the subgroups. This package provides a wrapper function of intern methods of `VT.tree` class : `vt.subgroups()`.
This function takes in argument :
* `vt.tree` : object or list of class `VT.tree`. Return of the `vt.tree()` function.
* `only.leaf` : logical. Set `TRUE` (default) to visualize only terminal nodes.
* `only.fav` : logical. Set `TRUE` (default) to visualize only class 1 nodes. ($\hat{A}$)
* `tables` : logical. Set `FALSE` (default) to prevent tables of incidences from being printed.
* `verbose` : logical. Set `FALSE` (default) to prevent detailed stuffs from being printed.
* `compete` : logical. Set `TRUE` to print competitors rules thanks to competitors split. `FALSE` is default value.
If `vt.tree` is a list, unique subgroups are printed.