lmtp
:package: Non-parametric Causal Effects Based on Modified Treatment Policies :crystal_ball:
Science Score: 39.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (20.4%) to scientific vocabulary
Keywords
causal-inference
censored-data
longitudinal-data
machine-learning
modified-treatment-policy
nonparametric-statistics
precision-medicine
robust-statistics
statistics
stochastic-interventions
survival-analysis
targeted-learning
Last synced: 6 months ago
·
JSON representation
Repository
:package: Non-parametric Causal Effects Based on Modified Treatment Policies :crystal_ball:
Basic Info
- Host: GitHub
- Owner: nt-williams
- License: agpl-3.0
- Language: R
- Default Branch: master
- Homepage: http://www.beyondtheate.com
- Size: 3.17 MB
Statistics
- Stars: 74
- Watchers: 5
- Forks: 24
- Open Issues: 16
- Releases: 8
Topics
causal-inference
censored-data
longitudinal-data
machine-learning
modified-treatment-policy
nonparametric-statistics
precision-medicine
robust-statistics
statistics
stochastic-interventions
survival-analysis
targeted-learning
Created almost 6 years ago
· Last pushed 6 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# lmtp
[](https://CRAN.R-project.org/package=lmtp)  [](https://github.com/nt-williams/lmtp/actions) [](https://app.codecov.io/gh/nt-williams/lmtp) [](https://www.gnu.org/licenses/gpl-3.0) [](https://www.repostatus.org/#active)
> Non-parametric Causal Effects of Feasible Interventions Based on Modified Treatment Policies
Nick Williams and Ivan Diaz
------------------------------------------------------------------------
**lmtp** is an R package that provides an estimation framework for the casual effects of feasible interventions based on point-treatment and longitudinal modified treatment policies as described in Diaz, Williams, Hoffman, and Schenck (2020). Two primary estimators are supported, a targeted maximum likelihood (TML) estimator and a sequentially doubly robust (SDR) estimator. Binary, continuous, time-to-event (including competing risks), and censored outcomes are allowed. **lmtp** is built atop the [`SuperLearner`](https://CRAN.R-project.org/package=SuperLearner) package to utilize ensemble machine learning for estimation. The treatment mechanism is estimated via a density ratio classification procedure irrespective of treatment variable type providing decreased computation time when treatment is continuous. Dynamic treatment regimes and incremental propensity scores based on the risk ratio are also supported.
For an in-depth look at the package's functionality, please consult the accompanying technical paper in [Observational Studies](https://muse.jhu.edu/article/883479).
## Installation
**lmtp** can be installed from CRAN with:
``` r
install.packages("lmtp")
```
The stable, development version can be installed from GitHub with:
``` r
devtools::install_github("nt-williams/lmtp@devel")
```
## What even is a modified treatment policy?
Modified treatment policies (MTP) are interventions that can depend on the *natural* value of the treatment (the treatment value in the absence of intervention). A key assumption for causal inference is the *positivity assumption* which states that all observations have a non-zero probability of experiencing a treatment value. **When working with continuous or multivalued treatments, violations of the positivity assumption are likely to occur. MTPs offer a solution to this problem.**
## Can lmtp estimate other effects?
Yes! **lmtp** can estimate the effects of deterministic, static treatment effects (such as the ATE) and deterministic, dynamic treatment regimes for binary, continuous, and survival outcomes.
### Features
| Feature | Status |
|---------------------------------------------------------|:-------------:|
| Point treatment | ✓ |
| Longitudinal treatment | ✓ |
| Modified treatment intervention | ✓ |
| Incremental Propensity Score Intervention (Using the risk ratio) | ✓ |
| Static intervention | ✓ |
| Dynamic intervention | ✓ |
| Continuous treatment | ✓ |
| Binary treatment | ✓ |
| Categorical treatment | ✓ |
| Multivariate treatment | ✓ |
| Missingness in treatment | |
| Continuous outcome | ✓ |
| Binary outcome | ✓ |
| Censored outcome | ✓ |
| Competing risks | ✓ |
| Mediation | |
| Survey weights | ✓ |
| Super learner | ✓ |
| Clustered data | ✓ |
| Parallel processing | ✓ |
| Progress bars | ✓ |
## Example
```{r}
library(lmtp)
# the data: 4 treatment nodes with time varying covariates and a binary outcome
head(sim_t4)
```
We're interested in a treatment policy, `d`, where exposure is decreased by 1 only among subjects whose exposure won't go below 1 if intervened upon. The true population outcome under this policy is about 0.305.
```{r}
# a treatment policy function to be applied at all time points
policy <- function(data, trt) {
(data[[trt]] - 1) * (data[[trt]] - 1 >= 1) + data[[trt]] * (data[[trt]] - 1 < 1)
}
```
In addition to specifying a treatment policy, we need to specify our treatment variables and time-varying covariates.
```{r}
# treatment nodes, a character vector of length 4
A <- c("A_1", "A_2", "A_3", "A_4")
# time varying nodes, a list of length 4
L <- list(c("L_1"), c("L_2"), c("L_3"), c("L_4"))
```
We can now estimate the effect of our treatment policy, `d`. In this example, we'll use the cross-validated TML estimator with 10 folds.
```{r, eval = FALSE}
lmtp_tmle(sim_t4, A, "Y", time_vary = L, shift = policy, mtp = TRUE, folds = 10)
#> LMTP Estimator: TMLE
#> Trt. Policy: (policy)
#>
#> ── Population intervention estimate ──
#>
#> Estimate: 0.25
#> Std. error: 0.02
#> 95% Conf. int.: 0.2, 0.29
```
## Data structure
#### Single time point
#### Time-varying exposure and confounders, not survival outcome
#### Single exposure, survival outcome
#### Time-varying exposure and confounders, survival outcome
## Similar Implementations
A variety of other R packages perform similar tasks as **lmtp**. However, **lmtp** is the only R package currently capable of estimating causal effects for binary, categorical, continuous, and mixture exposures in both the point treatment and longitudinal setting.
- [`txshift`](https://github.com/nhejazi/txshift)\
- [`tmle3`](https://github.com/tlverse/tmle3)\
- [`tmle3shift`](https://github.com/tlverse/tmle3shift)
- [`ltmle`](https://CRAN.R-project.org/package=ltmle)\
- [`tmle`](https://CRAN.R-project.org/package=tmle)
## Citation
Please cite the following when using **lmtp** in publications. Citation should include both the R package article and the paper establishing the statistical methodology.
```
@article{,
title = {lmtp: An R package for estimating the causal effects of modified treatment policies},
author = {Nicholas T Williams and Iván Díaz},
journal = {Observational Studies},
year = {2023},
url = {https://muse.jhu.edu/article/883479}
}
@article{
doi:10.1080/01621459.2021.1955691,
author = {Iván Díaz and Nicholas Williams and Katherine L. Hoffman and Edward J. Schenck},
title = {Non-parametric causal effects based on longitudinal modified treatment policies},
journal = {Journal of the American Statistical Association},
year = {2021},
doi = {10.1080/01621459.2021.1955691},
URL = {https://doi.org/10.1080/01621459.2021.1955691},
}
```
Owner
- Name: Nicholas Williams
- Login: nt-williams
- Kind: user
- Company: Columbia University
- Website: https://www.nicholastwilliams.com
- Twitter: nickWillyamz
- Repositories: 12
- Profile: https://github.com/nt-williams
Senior Data Analyst @ Columbia University Mailman School of Public Health & free-lance statistics software developer
GitHub Events
Total
- Issues event: 25
- Watch event: 13
- Delete event: 6
- Issue comment event: 19
- Push event: 55
- Pull request event: 23
- Fork event: 5
- Create event: 9
Last Year
- Issues event: 25
- Watch event: 13
- Delete event: 6
- Issue comment event: 19
- Push event: 55
- Pull request event: 23
- Fork event: 5
- Create event: 9
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Nick Williams | n****l@g****m | 554 |
| Nicholas Williams | 3****s | 6 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 92
- Total pull requests: 66
- Average time to close issues: 7 months
- Average time to close pull requests: about 1 month
- Total issue authors: 18
- Total pull request authors: 7
- Average comments per issue: 1.24
- Average comments per pull request: 0.11
- Merged pull requests: 49
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 16
- Pull requests: 25
- Average time to close issues: 28 days
- Average time to close pull requests: 22 days
- Issue authors: 8
- Pull request authors: 5
- Average comments per issue: 0.88
- Average comments per pull request: 0.04
- Merged pull requests: 15
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- nt-williams (63)
- kathoffman (6)
- idiazst (4)
- HenrikBengtsson (3)
- lorenzoFabbri (2)
- Lachlan-Cribb (2)
- XierDaiQiu (1)
- sebastiaan-blank (1)
- herbps10 (1)
- davidkreitmeir (1)
- jvpoulos (1)
- joshua-nugent (1)
- peterbruun (1)
- Lauren-EylerDang (1)
- shodaiinose (1)
Pull Request Authors
- nt-williams (58)
- herbps10 (10)
- shodaiinose (4)
- kathoffman (3)
- jakewilliami (2)
- alecmcclean (2)
Top Labels
Issue Labels
enhancement (6)
bug (4)
good first issue (1)
documentation (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 580 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 13
- Total maintainers: 1
cran.r-project.org: lmtp
Non-Parametric Causal Effects of Feasible Interventions Based on Modified Treatment Policies
- Homepage: https://beyondtheate.com/
- Documentation: http://cran.r-project.org/web/packages/lmtp/lmtp.pdf
- License: AGPL-3
-
Latest release: 1.5.3
published 7 months ago
Rankings
Forks count: 7.7%
Stargazers count: 8.0%
Average: 23.4%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 36.2%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 2.10 depends
- R6 * imports
- SuperLearner * imports
- checkmate >= 2.1.0 imports
- cli * imports
- data.table * imports
- future >= 1.17.0 imports
- generics * imports
- nnls * imports
- origami * imports
- progressr * imports
- stats * imports
- covr * suggests
- knitr * suggests
- ranger * suggests
- rmarkdown * suggests
- testthat >= 2.1.0 suggests
- twang * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite