Skip to content

Commit 674c119

Browse files
Merge pull request #19 from r-causal/weights
update generics and docs for weights
2 parents cfc4e84 + e072663 commit 674c119

File tree

7 files changed

+402
-140
lines changed

7 files changed

+402
-140
lines changed

R/weights.R

Lines changed: 260 additions & 72 deletions
Large diffs are not rendered by default.

inst/WORDLIST

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1+
ATC
2+
ATO
3+
ATT
4+
ATU
15
BYOM
26
CMD
7+
Codecov
8+
Hajage
9+
IPW
10+
Kostouraki
11+
Matchable
312
ORCID
13+
Rachet
414
Winsorize
15+
al
516
ato
617
att
718
cr
19+
doi
820
estimand
21+
estimands
22+
et
923
glm
1024
ps
1125
psw
12-
seealso
1326
trunc
1427
winsorizing
15-
Hajage
16-
IPW
17-
Kostouraki
18-
Rachet
19-
al
20-
ato
21-
att
22-
doi
23-
estimand
24-
et

man/ps_trim.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ps_trunc.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/wt_ate.Rd

Lines changed: 119 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-ps_trunc.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ test_that("atm_binary() logic with transform_.exposure_binary() is triggered", {
212212
w <- atm_binary(
213213
.propensity = ps_vec,
214214
.exposure = z_vec,
215-
exposure_type = "binary",
216215
.treated = 1
217216
)
218217
# Just check dimension, no error
@@ -255,7 +254,6 @@ test_that("ato_binary() logic is triggered for p=0.3", {
255254
w <- ato_binary(
256255
.propensity = ps_vec,
257256
.exposure = z_vec,
258-
exposure_type = "binary",
259257
.treated = 1
260258
)
261259
expect_length(w, 3)

tests/testthat/test-weights.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ test_that("ATE works for continuous cases", {
8989
)
9090

9191
expect_equal(weights, psw(wts, "ate"), tolerance = .01)
92-
expect_equal(stablized_weights, psw(stb_wts, "ate"), tolerance = .01)
92+
expect_equal(stablized_weights, psw(stb_wts, "ate", stabilized = TRUE), tolerance = .01)
9393
})
9494

9595
test_that("ATE works for categorical cases", {

0 commit comments

Comments
 (0)