Skip to content

Commit

Permalink
Merge pull request #30 from tlverse/catchup
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed Mar 13, 2021
2 parents daa0f96 + 136778b commit 43f6fc0
Show file tree
Hide file tree
Showing 37 changed files with 1,869 additions and 760 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ branches:
env:
global:
- RGL_USE_NULL=TRUE
- secure: TF4+d5Jj4KrwoEt7a8z0kk0+Y0K6ScKQpuAnGFFp/dSuNLPX76UmIIbKNWA/JhDpgdNyecHdwV+HRPgMj5/wDfokLX7IUMFdpWldDy84Df/m38T2fogspjFa7k3eMeucoOL8q79IUayuRq3g8qGaxa0Sm/JhFJcpqSdyrjAk5qNBDCrt9EcQB92PpiZnWCg4GHHAnegAFEtmmB2QLve6dwhPMS2kAa0mqRWNJVFhpnaNIn1A5rn3FfShtc4ccVfbYqSt7wMAKttjz+FnVSj42zR4IftoHXB1Jvfvdrh1K5iGuiSmiQoS4sxG1ktzqvkRDbRbxZ4GKT8VQ9DsISL3sALbpAyafLjdmxf76YGMldRztPAvkdgZMBPpvBer6x2fEkLgpq4MEnTwfhBABMwMoXUt/p3ed/HtrjTtlzUttZpQHvL+OgOguo6ZzfDSCWbChGU5v/d3at0xRCO0QJoClxZ1lhNn+5jpaH2VcTRidel4Yr3Y7HfJOumHO21mFjC87lHKqZZBcWd33s3Y2Km9AuYcy3pLM3BfU7BlAyUsEhUniaFFVC9yMj4LOuYTG1xjFkuvM7ZAn80bcXfz4JKmEDjzG9DxQDaETARdJfyIG+vsx+xmej1LaoHBeuIxfCRcMKZJzvXlq9aZCwSl8Ps/RequfJWRsyn2TXieDxGOP4Q=

language: r
sudo: required
Expand All @@ -19,9 +18,6 @@ r:
- release
- devel

before_install:
- Rscript -e 'update.packages(ask = FALSE)'

r_packages:
- devtools
- sessioninfo
Expand All @@ -30,13 +26,13 @@ r_packages:
- delayed
- origami
- hal9001
- haldensify

r_github_packages:
- r-lib/covr
- r-lib/sessioninfo
- tlverse/sl3
- tlverse/tmle3
- nhejazi/haldensify
- nhejazi/txshift

after_success:
Expand Down
104 changes: 104 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Contributing to `tmle3shift` development

We, the authors of the `tmle3shift` R package, use the same guide as is used for
contributing to the development of the popular `ggplot2` R package. This
document is simply a formal re-statement of that fact.

The goal of this guide is to help you get up and contributing to `tmle3shift` as
quickly as possible. The guide is divided into two main pieces:

* Filing a bug report or feature request in an issue.
* Suggesting a change via a pull request.

## Issues

When filing an issue, the most important thing is to include a minimal
reproducible example so that we can quickly verify the problem, and then figure
out how to fix it. There are three things you need to include to make your
example reproducible: required packages, data, code.

1. **Packages** should be loaded at the top of the script, so it's easy to
see which ones the example needs.

2. The easiest way to include **data** is to use `dput()` to generate the R
code to recreate it. For example, to recreate the `mtcars` dataset in R,
I'd perform the following steps:

1. Run `dput(mtcars)` in R
2. Copy the output
3. In my reproducible script, type `mtcars <- ` then paste.

But even better is if you can create a `data.frame()` with just a handful
of rows and columns that still illustrates the problem.

3. Spend a little bit of time ensuring that your **code** is easy for others to
read:

* make sure you've used spaces and your variable names are concise, but
informative

* use comments to indicate where your problem lies

* do your best to remove everything that is not related to the problem.
The shorter your code is, the easier it is to understand.

You can check you have actually made a reproducible example by starting up a
fresh R session and pasting your script in.

(Unless you've been specifically asked for it, please don't include the output
of `sessionInfo()`.)

## Pull requests

To contribute a change to `tmle3shift`, you follow these steps:

1. Create a branch in git and make your changes.
2. Push branch to github and issue pull request (PR).
3. Discuss the pull request.
4. Iterate until either we accept the PR or decide that it's not a good fit for
`tmle3shift`.

Each of these steps are described in more detail below. This might feel
overwhelming the first time you get set up, but it gets easier with practice.

If you're not familiar with git or GitHub, please start by reading
<http://r-pkgs.had.co.nz/git.html>

Pull requests will be evaluated against the a checklist:

1. __Motivation__. Your pull request should clearly and concisely motivates the
need for change. Plesae describe the problem your PR addresses and show
how your pull request solves it as concisely as possible.

Also include this motivation in `NEWS` so that when a new release of
ggplot2 comes out it's easy for users to see what's changed. Add your
item at the top of the file and use markdown for formatting. The
news item should end with `(@yourGithubUsername, #the_issue_number)`.

2. __Only related changes__. Before you submit your pull request, please
check to make sure that you haven't accidentally included any unrelated
changes. These make it harder to see exactly what's changed, and to
evaluate any unexpected side effects.

Each PR corresponds to a git branch, so if you expect to submit
multiple changes make sure to create multiple branches. If you have
multiple changes that depend on each other, start with the first one
and don't submit any others until the first one has been processed.

3. __Use `tmle3shift` coding style__. Please follow the
[official ggplot2 style](http://adv-r.had.co.nz/Style.html). Maintaing
a consistent style across the whole code base makes it much easier to
jump into the code. If you're modifying existing ggplot2 code that
doesn't follow the style guide, a separate pull request to fix the
style would be greatly appreciated.

4. If you're adding new parameters or a new function, you'll also need
to document them with [roxygen](https://github.com/klutometis/roxygen).
Make sure to re-run `devtools::document()` on the code before submitting.

This seems like a lot of work but don't worry if your pull request isn't
perfect. It's a learning process. A pull request is a process, and unless
you've submitted a few in the past it's unlikely that your pull request will be
accepted as is. Please don't submit pull requests that change existing
behaviour. Instead, think about how you can add a new feature in a minimally
invasive way.
24 changes: 11 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tmle3shift
Title: Targeted Learning of the Causal Effects of Stochastic Interventions
Version: 0.1.9
Version: 0.2.0
Authors@R: c(
person("Nima", "Hejazi", email = "nh@nimahejazi.org",
role = c("aut", "cre", "cph"),
Expand All @@ -18,10 +18,10 @@ Description: Targeted maximum likelihood estimation (TMLE) of population-level
variable importance analyses. Tools are provided for TML estimation of the
counterfactual mean under a stochastic intervention characterized as a
modified treatment policy, such as treatment policies that shift the natural
value of the exposure. The methodology implemented was first
described by I. Díaz and M.J. van der Laan (2013;
<doi:10.1111/j.1541-0420.2011.01685.x>) and expanded upon in I. Díaz and
M.J. van der Laan (2018).
value of the exposure. The causal parameter and estimation were described in
Díaz and van der Laan (2013) <doi:10.1111/j.1541-0420.2011.01685.x> and an
improved estimation approach was given by Díaz and van der Laan (2018)
<doi:10.1007/978-3-319-65304-4_14>.
Depends:
R (>= 3.4.0)
License: GPL-3
Expand All @@ -31,32 +31,30 @@ Imports:
methods,
data.table,
assertthat,
tmle3
tmle3 (>= 0.2.0)
Suggests:
testthat,
knitr,
rmarkdown,
covr,
stats,
ggplot2,
sl3 (>= 1.3.7),
txshift (>= 0.3.1),
sl3 (>= 1.4.2),
txshift (>= 0.3.5),
haldensify (>= 0.0.5),
hal9001,
xgboost,
ranger,
Rsolnp,
nnls,
nnls
Remotes:
github::tlverse/sl3,
github::tlverse/tmle3@devel,
github::nhejazi/haldensify,
github::nhejazi/txshift
github::tlverse/tmle3
URL: https://tlverse.org/tmle3shift
BugReports: https://github.com/tlverse/tmle3shift/issues
Encoding: UTF-8
LazyData: true
LazyLoad: yes
VignetteBuilder: knitr
RoxygenNote: 7.0.2
RoxygenNote: 7.1.1
Roxygen: list(markdown = TRUE, r6 = FALSE)
28 changes: 28 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ knitr::opts_chunk$set(
[![Coverage Status](https://img.shields.io/codecov/c/github/tlverse/tmle3shift/master.svg)](https://codecov.io/github/tlverse/tmle3shift?branch=master)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4603372.svg)](https://doi.org/10.5281/zenodo.4603372)

> Targeted Learning of the Causal Effects of Stochastic Interventions
Expand Down Expand Up @@ -75,6 +76,33 @@ issue](https://github.com/tlverse/tmle3shift/issues).

---

## Contributions

Contributions are very welcome. Interested contributors should consult our
[contribution
guidelines](https://github.com/tlverse/tmle3shift/blob/master/CONTRIBUTING.md)
prior to submitting a pull request.

---

## Citation

After using the `tmle3shift` R package, please cite the following:

@software{hejazi2021tmle3shift-rpkg,
author = {Hejazi, Nima S and Coyle, Jeremy R and {van der Laan}, Mark
J},
title = {{tmle3shift}: {Targeted Learning} of the Causal Effects of
Stochastic Interventions},
year = {2021},
howpublished = {\url{https://github.com/tlverse/tmle3shift}},
note = {{R} package version 0.2.0},
url = {https://doi.org/10.5281/zenodo.4603372},
doi = {10.5281/zenodo.4603372}
}

---

## Related

* [R/`txshift`](https://github.com/nhejazi/txshift) - An R package providing an
Expand Down
47 changes: 39 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ state and is being actively
developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![License: GPL
v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4603372.svg)](https://doi.org/10.5281/zenodo.4603372)

> Targeted Learning of the Causal Effects of Stochastic Interventions
Expand All @@ -34,11 +35,12 @@ builds upon the core `tlverse` grammar introduced by `tmle3`, a general
framework that supports the implementation of a range of TMLE parameters
through a unified interface. For a detailed description of the target
parameter, TML estimator, and algorithm implemented in `tmle3shift`, the
interested reader is invited to consult Díaz and van der Laan (2012) and
Díaz and van der Laan (2018). For a general discussion of the framework
of targeted minimum loss-based estimation and the role this methodology
plays in statistical and causal inference, the canonical references are
van der Laan and Rose (2011) and van der Laan and Rose (2018).
interested reader is invited to consult Dı́az and van der Laan (2012)
and Dı́az and van der Laan (2018). For a general discussion of the
framework of targeted minimum loss-based estimation and the role this
methodology plays in statistical and causal inference, the canonical
references are van der Laan and Rose (2011) and van der Laan and Rose
(2018).

Building on the original work surrounding the TML estimator for the
aforementioned target parameter, `tmle3shift` additionally implements a
Expand Down Expand Up @@ -70,6 +72,35 @@ If you encounter any bugs or have any specific feature requests, please

-----

## Contributions

Contributions are very welcome. Interested contributors should consult
our [contribution
guidelines](https://github.com/tlverse/tmle3shift/blob/master/CONTRIBUTING.md)
prior to submitting a pull request.

-----

## Citation

After using the `tmle3shift` R package, please cite the following:

```
@software{hejazi2021tmle3shift-rpkg,
author = {Hejazi, Nima S and Coyle, Jeremy R and {van der Laan}, Mark
J},
title = {{tmle3shift}: {Targeted Learning} of the Causal Effects of
Stochastic Interventions},
year = {2021},
howpublished = {\url{https://github.com/tlverse/tmle3shift}},
note = {{R} package version 0.2.0},
url = {https://doi.org/10.5281/zenodo.4603372},
doi = {10.5281/zenodo.4603372}
}
```

-----

## Related

- [R/`txshift`](https://github.com/nhejazi/txshift) - An R package
Expand Down Expand Up @@ -100,9 +131,9 @@ See file `LICENSE` for details.

<div id="ref-diaz2012population">

Díaz, Iván, and Mark J van der Laan. 2012. “Population Intervention
Causal Effects Based on Stochastic Interventions.” *Biometrics* 68 (2).
Wiley Online Library: 541–49.
Dı́az, Iván, and Mark J van der Laan. 2012. “Population Intervention
Causal Effects Based on Stochastic Interventions.” *Biometrics* 68 (2):
541–49.

</div>

Expand Down
7 changes: 2 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ environment:
PKGTYPE: both
R_REMOTES_STANDALONE: true
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT:
secure: Nu6c5CmcVdYHDUVGej5ZIXGKOXVPBwqUwjrLV8d6UlbUaAtYuUhgpNuv9oLztAQQ

matrix:
- R_VERSION: release
Expand All @@ -36,9 +34,8 @@ build_script:
- echo Current directory=%CD%
- travis-tool.sh install_r base64
- travis-tool.sh install_github r-lib/sessioninfo r-lib/covr
- travis-tool.sh install_github tlverse/delayed tlverse/origami
- travis-tool.sh install_github tlverse/hal9001 tlverse/sl3 tlverse/tmle3
- travis-tool.sh install_github nhejazi/haldensify nhejazi/txshift
- travis-tool.sh install_github tlverse/sl3 tlverse/tmle3
- travis-tool.sh install_github nhejazi/txshift
- travis-tool.sh install_deps

test_script:
Expand Down
Loading

0 comments on commit 43f6fc0

Please sign in to comment.