Skip to content

Commit

Permalink
Add function links to vignettes (grf-labs#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikcs authored Mar 31, 2022
1 parent 6e4442c commit 8135b8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion r-package/grf/vignettes/rate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library(grf)
library(ggplot2)
```

This vignette gives a brief introduction to how the *Rank-Weighted Average Treatment Effect* (*RATE*) available in the function `rank_average_treatment_effect` can be used to evaluate how good treatment *prioritization rules* (such as conditional average treatment effect estimates) are at distinguishing subpopulations with different treatment effects, or whether there is any notable heterogeneity present. The second part of the vignette gives a worked example from a medical setting using (synthetic) data from the SPRINT and ACCORD hypertension drug trials. For complete details we refer to the [RATE paper](https://arxiv.org/abs/2111.07966).
This vignette gives a brief introduction to how the *Rank-Weighted Average Treatment Effect* (*RATE*) available in the function [rank_average_treatment_effect](https://grf-labs.github.io/grf/reference/rank_average_treatment_effect.html) can be used to evaluate how good treatment *prioritization rules* (such as conditional average treatment effect estimates) are at distinguishing subpopulations with different treatment effects, or whether there is any notable heterogeneity present. The second part of the vignette gives a worked example from a medical setting using (synthetic) data from the SPRINT and ACCORD hypertension drug trials. For complete details we refer to the [RATE paper](https://arxiv.org/abs/2111.07966).

## Treatment prioritization rules
We are in the familiar experimental setting (or unconfounded observational study) and are interested in the problem of determining which individuals to assign a binary treatment $W=\{0, 1\}$ and the associated value of this treatment allocation strategy. Given some subject characteristics $X_i$ we have access to a subject-specific treatment *prioritization rule* $S(X_i)$ which assigns scores to subjects. This prioritization rule should give a high score to units which we believe to have a large benefit of treatment and a low score to units with a low benefit of treatment. By benefit of treatment, we mean the difference in outcomes $Y$ from receiving the treatment given some subject characteristics $X_i$, as given by the conditional average treatment effect (CATE)
Expand Down
4 changes: 2 additions & 2 deletions r-package/grf/vignettes/survival.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library(ggplot2)
library(grf)
```

This vignette gives a brief beginner-friendly overview of how non-parametric estimators like GRF can be used to flexibly estimate treatment effects in a survival setting where we want to remain agnostic on assumptions for the censoring and survival process. The first part of this vignette gives a basic intro to right-censored data and issues with estimating an average survival time. The second part shows how GRF can use `sample.weights` to construct an IPCW-based `causal_forest`, and explains the more powerful estimation approach available in the function `causal_survival_forest`.
This vignette gives a brief beginner-friendly overview of how non-parametric estimators like GRF can be used to flexibly estimate treatment effects in a survival setting where we want to remain agnostic on assumptions for the censoring and survival process. The first part of this vignette gives a basic intro to right-censored data and issues with estimating an average survival time. The second part shows how GRF can use `sample.weights` to construct an IPCW-based [causal_forest](https://grf-labs.github.io/grf/reference/causal_forest.html), and explains the more powerful estimation approach available in the function [causal_survival_forest](https://grf-labs.github.io/grf/reference/causal_survival_forest.html).

## Right-censored data
<img src="California_Sea_Otter.jpg" align="right" height="120"/ alt="California sea otter, photo credit Michael Baird">
Expand Down Expand Up @@ -198,7 +198,7 @@ D <- as.integer(event.time <= censor.time)
```

## Causal forest with sample weights
This section shows how we can use estimated sample weights to adopt `causal_forest` for IPCW estimation. Most GRF estimators have an optional `sample.weights` argument which is taken into account during all steps of the GRF algorithm (relabeling/splitting/prediction). We start by using a `survival_forest` to estimate the censoring process $P[C_i > t \, | X_i = x]$, then pick out the appropriate censoring probabilities $P[C_i > \hat T_i \, | X_i = x]$. In our example the censoring probabilities are "easy" to estimate: they are all uniform. However, many applications involve more complex censoring patterns, it would not be unreasonable to expect that the size of the otter pup mattered for the censoring probabilities, as a larger pup might allow the measurement device to be strapped on more securely and thus less likely to break than on a smaller pup. Estimating $P[C_i > t \, | X_i = x]$ non-parametrically with GRF's `survival_forest` allows us to be agnostic to this.
This section shows how we can use estimated sample weights to adopt `causal_forest` for IPCW estimation. Most GRF estimators have an optional `sample.weights` argument which is taken into account during all steps of the GRF algorithm (relabeling/splitting/prediction). We start by using a [survival_forest](https://grf-labs.github.io/grf/reference/survival_forest.html) to estimate the censoring process $P[C_i > t \, | X_i = x]$, then pick out the appropriate censoring probabilities $P[C_i > \hat T_i \, | X_i = x]$. In our example the censoring probabilities are "easy" to estimate: they are all uniform. However, many applications involve more complex censoring patterns, it would not be unreasonable to expect that the size of the otter pup mattered for the censoring probabilities, as a larger pup might allow the measurement device to be strapped on more securely and thus less likely to break than on a smaller pup. Estimating $P[C_i > t \, | X_i = x]$ non-parametrically with GRF's `survival_forest` allows us to be agnostic to this.

```{r}
sf.censor <- survival_forest(X, Y, 1 - D)
Expand Down

0 comments on commit 8135b8b

Please sign in to comment.