Skip to content

Commit 43f6fc0

Browse files
authored
Merge pull request #30 from tlverse/catchup
2 parents daa0f96 + 136778b commit 43f6fc0

37 files changed

+1869
-760
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ branches:
55
env:
66
global:
77
- RGL_USE_NULL=TRUE
8-
- secure: TF4+d5Jj4KrwoEt7a8z0kk0+Y0K6ScKQpuAnGFFp/dSuNLPX76UmIIbKNWA/JhDpgdNyecHdwV+HRPgMj5/wDfokLX7IUMFdpWldDy84Df/m38T2fogspjFa7k3eMeucoOL8q79IUayuRq3g8qGaxa0Sm/JhFJcpqSdyrjAk5qNBDCrt9EcQB92PpiZnWCg4GHHAnegAFEtmmB2QLve6dwhPMS2kAa0mqRWNJVFhpnaNIn1A5rn3FfShtc4ccVfbYqSt7wMAKttjz+FnVSj42zR4IftoHXB1Jvfvdrh1K5iGuiSmiQoS4sxG1ktzqvkRDbRbxZ4GKT8VQ9DsISL3sALbpAyafLjdmxf76YGMldRztPAvkdgZMBPpvBer6x2fEkLgpq4MEnTwfhBABMwMoXUt/p3ed/HtrjTtlzUttZpQHvL+OgOguo6ZzfDSCWbChGU5v/d3at0xRCO0QJoClxZ1lhNn+5jpaH2VcTRidel4Yr3Y7HfJOumHO21mFjC87lHKqZZBcWd33s3Y2Km9AuYcy3pLM3BfU7BlAyUsEhUniaFFVC9yMj4LOuYTG1xjFkuvM7ZAn80bcXfz4JKmEDjzG9DxQDaETARdJfyIG+vsx+xmej1LaoHBeuIxfCRcMKZJzvXlq9aZCwSl8Ps/RequfJWRsyn2TXieDxGOP4Q=
98

109
language: r
1110
sudo: required
@@ -19,9 +18,6 @@ r:
1918
- release
2019
- devel
2120

22-
before_install:
23-
- Rscript -e 'update.packages(ask = FALSE)'
24-
2521
r_packages:
2622
- devtools
2723
- sessioninfo
@@ -30,13 +26,13 @@ r_packages:
3026
- delayed
3127
- origami
3228
- hal9001
29+
- haldensify
3330

3431
r_github_packages:
3532
- r-lib/covr
3633
- r-lib/sessioninfo
3734
- tlverse/sl3
3835
- tlverse/tmle3
39-
- nhejazi/haldensify
4036
- nhejazi/txshift
4137

4238
after_success:

CONTRIBUTING.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Contributing to `tmle3shift` development
2+
3+
We, the authors of the `tmle3shift` R package, use the same guide as is used for
4+
contributing to the development of the popular `ggplot2` R package. This
5+
document is simply a formal re-statement of that fact.
6+
7+
The goal of this guide is to help you get up and contributing to `tmle3shift` as
8+
quickly as possible. The guide is divided into two main pieces:
9+
10+
* Filing a bug report or feature request in an issue.
11+
* Suggesting a change via a pull request.
12+
13+
## Issues
14+
15+
When filing an issue, the most important thing is to include a minimal
16+
reproducible example so that we can quickly verify the problem, and then figure
17+
out how to fix it. There are three things you need to include to make your
18+
example reproducible: required packages, data, code.
19+
20+
1. **Packages** should be loaded at the top of the script, so it's easy to
21+
see which ones the example needs.
22+
23+
2. The easiest way to include **data** is to use `dput()` to generate the R
24+
code to recreate it. For example, to recreate the `mtcars` dataset in R,
25+
I'd perform the following steps:
26+
27+
1. Run `dput(mtcars)` in R
28+
2. Copy the output
29+
3. In my reproducible script, type `mtcars <- ` then paste.
30+
31+
But even better is if you can create a `data.frame()` with just a handful
32+
of rows and columns that still illustrates the problem.
33+
34+
3. Spend a little bit of time ensuring that your **code** is easy for others to
35+
read:
36+
37+
* make sure you've used spaces and your variable names are concise, but
38+
informative
39+
40+
* use comments to indicate where your problem lies
41+
42+
* do your best to remove everything that is not related to the problem.
43+
The shorter your code is, the easier it is to understand.
44+
45+
You can check you have actually made a reproducible example by starting up a
46+
fresh R session and pasting your script in.
47+
48+
(Unless you've been specifically asked for it, please don't include the output
49+
of `sessionInfo()`.)
50+
51+
## Pull requests
52+
53+
To contribute a change to `tmle3shift`, you follow these steps:
54+
55+
1. Create a branch in git and make your changes.
56+
2. Push branch to github and issue pull request (PR).
57+
3. Discuss the pull request.
58+
4. Iterate until either we accept the PR or decide that it's not a good fit for
59+
`tmle3shift`.
60+
61+
Each of these steps are described in more detail below. This might feel
62+
overwhelming the first time you get set up, but it gets easier with practice.
63+
64+
If you're not familiar with git or GitHub, please start by reading
65+
<http://r-pkgs.had.co.nz/git.html>
66+
67+
Pull requests will be evaluated against the a checklist:
68+
69+
1. __Motivation__. Your pull request should clearly and concisely motivates the
70+
need for change. Plesae describe the problem your PR addresses and show
71+
how your pull request solves it as concisely as possible.
72+
73+
Also include this motivation in `NEWS` so that when a new release of
74+
ggplot2 comes out it's easy for users to see what's changed. Add your
75+
item at the top of the file and use markdown for formatting. The
76+
news item should end with `(@yourGithubUsername, #the_issue_number)`.
77+
78+
2. __Only related changes__. Before you submit your pull request, please
79+
check to make sure that you haven't accidentally included any unrelated
80+
changes. These make it harder to see exactly what's changed, and to
81+
evaluate any unexpected side effects.
82+
83+
Each PR corresponds to a git branch, so if you expect to submit
84+
multiple changes make sure to create multiple branches. If you have
85+
multiple changes that depend on each other, start with the first one
86+
and don't submit any others until the first one has been processed.
87+
88+
3. __Use `tmle3shift` coding style__. Please follow the
89+
[official ggplot2 style](http://adv-r.had.co.nz/Style.html). Maintaing
90+
a consistent style across the whole code base makes it much easier to
91+
jump into the code. If you're modifying existing ggplot2 code that
92+
doesn't follow the style guide, a separate pull request to fix the
93+
style would be greatly appreciated.
94+
95+
4. If you're adding new parameters or a new function, you'll also need
96+
to document them with [roxygen](https://github.com/klutometis/roxygen).
97+
Make sure to re-run `devtools::document()` on the code before submitting.
98+
99+
This seems like a lot of work but don't worry if your pull request isn't
100+
perfect. It's a learning process. A pull request is a process, and unless
101+
you've submitted a few in the past it's unlikely that your pull request will be
102+
accepted as is. Please don't submit pull requests that change existing
103+
behaviour. Instead, think about how you can add a new feature in a minimally
104+
invasive way.

DESCRIPTION

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: tmle3shift
22
Title: Targeted Learning of the Causal Effects of Stochastic Interventions
3-
Version: 0.1.9
3+
Version: 0.2.0
44
Authors@R: c(
55
person("Nima", "Hejazi", email = "nh@nimahejazi.org",
66
role = c("aut", "cre", "cph"),
@@ -18,10 +18,10 @@ Description: Targeted maximum likelihood estimation (TMLE) of population-level
1818
variable importance analyses. Tools are provided for TML estimation of the
1919
counterfactual mean under a stochastic intervention characterized as a
2020
modified treatment policy, such as treatment policies that shift the natural
21-
value of the exposure. The methodology implemented was first
22-
described by I. Díaz and M.J. van der Laan (2013;
23-
<doi:10.1111/j.1541-0420.2011.01685.x>) and expanded upon in I. Díaz and
24-
M.J. van der Laan (2018).
21+
value of the exposure. The causal parameter and estimation were described in
22+
Díaz and van der Laan (2013) <doi:10.1111/j.1541-0420.2011.01685.x> and an
23+
improved estimation approach was given by Díaz and van der Laan (2018)
24+
<doi:10.1007/978-3-319-65304-4_14>.
2525
Depends:
2626
R (>= 3.4.0)
2727
License: GPL-3
@@ -31,32 +31,30 @@ Imports:
3131
methods,
3232
data.table,
3333
assertthat,
34-
tmle3
34+
tmle3 (>= 0.2.0)
3535
Suggests:
3636
testthat,
3737
knitr,
3838
rmarkdown,
3939
covr,
4040
stats,
4141
ggplot2,
42-
sl3 (>= 1.3.7),
43-
txshift (>= 0.3.1),
42+
sl3 (>= 1.4.2),
43+
txshift (>= 0.3.5),
4444
haldensify (>= 0.0.5),
4545
hal9001,
4646
xgboost,
4747
ranger,
4848
Rsolnp,
49-
nnls,
49+
nnls
5050
Remotes:
5151
github::tlverse/sl3,
52-
github::tlverse/tmle3@devel,
53-
github::nhejazi/haldensify,
54-
github::nhejazi/txshift
52+
github::tlverse/tmle3
5553
URL: https://tlverse.org/tmle3shift
5654
BugReports: https://github.com/tlverse/tmle3shift/issues
5755
Encoding: UTF-8
5856
LazyData: true
5957
LazyLoad: yes
6058
VignetteBuilder: knitr
61-
RoxygenNote: 7.0.2
59+
RoxygenNote: 7.1.1
6260
Roxygen: list(markdown = TRUE, r6 = FALSE)

README.Rmd

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ knitr::opts_chunk$set(
2121
[![Coverage Status](https://img.shields.io/codecov/c/github/tlverse/tmle3shift/master.svg)](https://codecov.io/github/tlverse/tmle3shift?branch=master)
2222
[![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)
2323
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
24+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4603372.svg)](https://doi.org/10.5281/zenodo.4603372)
2425

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

7677
---
7778

79+
## Contributions
80+
81+
Contributions are very welcome. Interested contributors should consult our
82+
[contribution
83+
guidelines](https://github.com/tlverse/tmle3shift/blob/master/CONTRIBUTING.md)
84+
prior to submitting a pull request.
85+
86+
---
87+
88+
## Citation
89+
90+
After using the `tmle3shift` R package, please cite the following:
91+
92+
@software{hejazi2021tmle3shift-rpkg,
93+
author = {Hejazi, Nima S and Coyle, Jeremy R and {van der Laan}, Mark
94+
J},
95+
title = {{tmle3shift}: {Targeted Learning} of the Causal Effects of
96+
Stochastic Interventions},
97+
year = {2021},
98+
howpublished = {\url{https://github.com/tlverse/tmle3shift}},
99+
note = {{R} package version 0.2.0},
100+
url = {https://doi.org/10.5281/zenodo.4603372},
101+
doi = {10.5281/zenodo.4603372}
102+
}
103+
104+
---
105+
78106
## Related
79107

80108
* [R/`txshift`](https://github.com/nhejazi/txshift) - An R package providing an

README.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ state and is being actively
1414
developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
1515
[![License: GPL
1616
v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
17+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4603372.svg)](https://doi.org/10.5281/zenodo.4603372)
1718

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

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

7173
-----
7274

75+
## Contributions
76+
77+
Contributions are very welcome. Interested contributors should consult
78+
our [contribution
79+
guidelines](https://github.com/tlverse/tmle3shift/blob/master/CONTRIBUTING.md)
80+
prior to submitting a pull request.
81+
82+
-----
83+
84+
## Citation
85+
86+
After using the `tmle3shift` R package, please cite the following:
87+
88+
```
89+
@software{hejazi2021tmle3shift-rpkg,
90+
author = {Hejazi, Nima S and Coyle, Jeremy R and {van der Laan}, Mark
91+
J},
92+
title = {{tmle3shift}: {Targeted Learning} of the Causal Effects of
93+
Stochastic Interventions},
94+
year = {2021},
95+
howpublished = {\url{https://github.com/tlverse/tmle3shift}},
96+
note = {{R} package version 0.2.0},
97+
url = {https://doi.org/10.5281/zenodo.4603372},
98+
doi = {10.5281/zenodo.4603372}
99+
}
100+
```
101+
102+
-----
103+
73104
## Related
74105

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

101132
<div id="ref-diaz2012population">
102133

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

107138
</div>
108139

appveyor.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ environment:
2525
PKGTYPE: both
2626
R_REMOTES_STANDALONE: true
2727
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
28-
GITHUB_PAT:
29-
secure: Nu6c5CmcVdYHDUVGej5ZIXGKOXVPBwqUwjrLV8d6UlbUaAtYuUhgpNuv9oLztAQQ
3028

3129
matrix:
3230
- R_VERSION: release
@@ -36,9 +34,8 @@ build_script:
3634
- echo Current directory=%CD%
3735
- travis-tool.sh install_r base64
3836
- travis-tool.sh install_github r-lib/sessioninfo r-lib/covr
39-
- travis-tool.sh install_github tlverse/delayed tlverse/origami
40-
- travis-tool.sh install_github tlverse/hal9001 tlverse/sl3 tlverse/tmle3
41-
- travis-tool.sh install_github nhejazi/haldensify nhejazi/txshift
37+
- travis-tool.sh install_github tlverse/sl3 tlverse/tmle3
38+
- travis-tool.sh install_github nhejazi/txshift
4239
- travis-tool.sh install_deps
4340

4441
test_script:

0 commit comments

Comments
 (0)