Skip to content

Commit

Permalink
version 4.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ngreifer authored and cran-robot committed Jan 11, 2024
1 parent 5fc1a22 commit 5c34204
Show file tree
Hide file tree
Showing 19 changed files with 786 additions and 549 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: cobalt
Title: Covariate Balance Tables and Plots
Version: 4.5.2
Version: 4.5.3
Authors@R: c(
person("Noah", "Greifer", role=c("aut", "cre"),
email = "noah.greifer@gmail.com",
Expand All @@ -21,7 +21,7 @@ Suggests: MatchIt (>= 4.0.0), WeightIt (>= 0.14.0), twang (>= 1.6),
twangContinuous, Matching, optmatch, ebal, CBPS (>= 0.17),
designmatch, optweight, mice (>= 3.8.0), MatchThem (>= 0.9.3),
cem (>= 1.1.30), sbw (>= 1.1.5), gbm (>= 2.1.7), brglm2 (>=
0.9), knitr, rmarkdown, testthat (>= 3.0.0)
0.9), caret, knitr, rmarkdown, testthat (>= 3.0.0)
License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
Expand All @@ -32,8 +32,8 @@ BugReports: https://github.com/ngreifer/cobalt/issues
Config/testthat/edition: 3
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2023-11-20 21:18:43 UTC; NoahGreifer
Packaged: 2024-01-09 19:59:37 UTC; NoahGreifer
Author: Noah Greifer [aut, cre] (<https://orcid.org/0000-0003-3067-7154>)
Maintainer: Noah Greifer <noah.greifer@gmail.com>
Repository: CRAN
Date/Publication: 2023-11-20 22:10:02 UTC
Date/Publication: 2024-01-10 03:23:07 UTC
35 changes: 18 additions & 17 deletions MD5
@@ -1,9 +1,9 @@
0158cab8d8bf46183d0f94da48f13378 *DESCRIPTION
0bda3b806772b07a115818a4f52729ec *DESCRIPTION
4981c0f845a039589d95417e88af6c67 *NAMESPACE
0c2ec25f3360696a47d567ec1fe13cb1 *NEWS.md
c287ea9599744cbb3788cc4301a0bfde *NEWS.md
f1d4ff9beae81e518ef62d60f28b2bce *R/SHARED.R
fff3a723a38837266b1022ecfd1f63eb *R/bal.compute.R
aa69cf206314afc9754e372d5535a804 *R/bal.plot.R
e1d3b78833fd4d1ad7a8bcfd38776275 *R/bal.compute.R
79fbfa651a1fc33852f0b7565ef54e21 *R/bal.plot.R
d8b12395e20752abc0d30985b11ee32e *R/bal.tab.CBPS.R
fb56d5943508c43a13ac7e176e6c6720 *R/bal.tab.Match.R
ea74cade6d7f2cf4979e4fa0df618988 *R/bal.tab.R
Expand All @@ -20,52 +20,52 @@ e76b8d8e8953c01748ccc0eb6e490e17 *R/bal.tab.ps.R
4abd1e86472a7fbb97375e3c0518176a *R/bal.tab.time.list.R
f90c1768433f196dbc269838278a34b9 *R/bal.tab.weightit.R
819a9aa2a18bc85894d61c06d3cc2f87 *R/balance-statistics.R
794b22ddb9a67048b46cd592dc15a89d *R/balance-summary.R
1cba99e388d355a7c8926ce933e6a623 *R/base.bal.tab.R
a837f9612fae4e207aaba929dc7d830f *R/balance-summary.R
a2670611cf4af6cef19b64ffc27ebade *R/base.bal.tab.R
fb1dede748e290f35a8a40f9ee07fc2e *R/chk-functions.R
14d10d099701dc063e06f3265bf79c3f *R/class-bal.tab.cluster.R
b0ba8644c63990f1e13c31509501a38c *R/class-bal.tab.cluster.R
d123d2f321757e946bb00f9f17b5de44 *R/class-bal.tab.imp.R
e28c2b4c8a95f839f923769f480b33df *R/class-bal.tab.msm.R
cbac12dc86cd0ed0b73d19e1631cd1c8 *R/class-bal.tab.multi.R
f3656522c1fad5c0fbe98528a33ae639 *R/class-bal.tab.subclass.R
7da74b107ec560d22a6bb0de9e5919cd *R/cobalt-package.R
b7d49c42086e0514344a00f8767e9cdf *R/display-options.R
2ab61912eff72dab752a41c3ca12fca0 *R/f.build.R
bc2bf36676c63e209dea20b70e003ca1 *R/functions_for_processing.R
b21acdd744b79f3b036879c0a5466de3 *R/functions_for_processing.R
1f95a4b48fb06f1a7141af54339bfad7 *R/get.w.R
fef3f14dd7f1338d7955be6d6baa73ae *R/lalonde.R
b272aae3e57e7bf991e0fa9615f169a8 *R/love.plot.R
26ddb9530227d400ec7fdb9855cc0b80 *R/love.plot.R
3e3e9d4484baf5165ff7af130bef5ba1 *R/print.bal.tab.R
fec5b46755283a32ac63213c5a523857 *R/set.cobalt.options.R
4a10cc38448539fb9ddc67686032ce98 *R/splitfactor.R
50b974f1f161aa4eaf0569364e07472d *R/splitfactor.R
8412ef1e56507bc643d04c059405435c *R/var.names.R
337cf334c024386ff5b1a1cb9b5cbc9f *R/x2base.R
aa4f8e3e3cfe7bd87bd71699e7031559 *R/zzz.R
1eba6780abf3ced5bc6c2d74c828fc23 *README.md
bb961542a204a18ddc5e252bc42d1dcf *build/cobalt.pdf
db59aa541f101cb168afcf1c828251d0 *build/stage23.rdb
e8dc0c2c141189d5b42f0c338640d405 *build/cobalt.pdf
fc3b44037734c8022b727716182accac *build/stage23.rdb
c2a44ea909757842757512a030434698 *build/vignette.rds
949b492287de79b9a90d520db98768c1 *data/lalonde.RData
d22e5afa667cdc190e348ae984c830a2 *data/lalonde_mis.RData
7f7b5e57e80618fa4430b35f7b70b543 *inst/WORDLIST
8360dda77d80858e6d77fb302e39f3a3 *inst/doc/cobalt.R
607225ae73d7222803ff5ada2f46f45d *inst/doc/cobalt.Rmd
5bcaf7ab1a9f24390a2f3997534c30bb *inst/doc/cobalt.html
b62e06656e3cec984139422fbb2e6ae0 *inst/doc/cobalt.html
a1b6ff449f81e7a293af442a09d85f19 *inst/doc/longitudinal-treat.R
655fe9c70ce39b4420fc937734a369e3 *inst/doc/longitudinal-treat.Rmd
acc5235a0099c1480137e76e1be12e7e *inst/doc/longitudinal-treat.html
82c6d91b8a9621ad2c75c6e5fb60c010 *inst/doc/longitudinal-treat.html
14e086d8a4708bc3f1258ccc4fee4ebf *inst/doc/love.plot.R
c6fd2f677bf6622f922b3486ba90c4fb *inst/doc/love.plot.Rmd
af39252a287551711222a572404b7214 *inst/doc/love.plot.html
0e3244fdf8dec683ba4911136362e3c5 *inst/doc/love.plot.html
e65edf51b139b5f1762348c64662c880 *inst/doc/optimizing-balance.R
f694e6e938e26356753b55c873b58f53 *inst/doc/optimizing-balance.Rmd
53c6a9aaf708d293cc9a838d3b7762fa *inst/doc/optimizing-balance.html
f4afc669d878dfcee242d7e57bc05f73 *inst/doc/other-packages.R
80998c9be05c38dfa08df333f010d65c *inst/doc/other-packages.Rmd
d0c3f7e6e8a3372513ac08635a981742 *inst/doc/other-packages.html
419f84ea2c20023c9d4d27fac8d16265 *inst/doc/other-packages.html
e12a2823aadc656ebf46f870b1dc56ee *inst/doc/segmented-data.R
7b1e8d61fa1cd5457a9ccbedc183d8ac *inst/doc/segmented-data.Rmd
40ead14eaf6e2e9de91dd8916137682a *inst/doc/segmented-data.html
f0d83f69692a3d6c08d8a2c8f6df59af *inst/doc/segmented-data.html
5940bb6c0938c9bfcfd12b9779ca2ed2 *man/bal.compute.Rd
a8b611be3c2b7d2f44b74be7cfb5f422 *man/bal.plot.Rd
91b9b6cd14b9124cfe441ca94430e4b5 *man/bal.tab.CBPS.Rd
Expand Down Expand Up @@ -110,6 +110,7 @@ b8dcf5a839f4fea80ab6a6a41008639c *tests/testthat.R
46b4fd02f9d05961d1322c83448dc21a *tests/testthat/test-bal.compute.R
f4fce1434d0e626fa5903fb5df06da34 *tests/testthat/test-bal.tab.data.frame.R
3f972a07ac39c7c69d2ee494fe252862 *tests/testthat/test-bal.tab.weightit.R
38e32e94273f0c812ccea5634bc6126c *tests/testthat/test-github-issues.R
607225ae73d7222803ff5ada2f46f45d *vignettes/cobalt.Rmd
655fe9c70ce39b4420fc937734a369e3 *vignettes/longitudinal-treat.Rmd
c6fd2f677bf6622f922b3486ba90c4fb *vignettes/love.plot.Rmd
Expand Down
14 changes: 13 additions & 1 deletion NEWS.md
@@ -1,6 +1,18 @@
`cobalt` News and Updates
======

# cobalt 4.5.3

* Fixed a bug when missing values were present in continuous covariates. Thanks to @vnusinfo. (#76)

* Fixed a bug when using `bal.tab()` with the `cluster` argument supplied with the `caret` package loaded. Thanks to @BorgeJorge. (#77)

* When `cluster` is specified, categorical variables that perfectly coincide with the cluster variable are now correctly removed.

* Perfectly colinear variables are no longer removed (unless they are binary variables split from the same factor). This should speed up evaluation and reduce the probability of false positives being removed.

* Variables with a single value are now more reliably categorized as "binary" in tables and calculations.

# cobalt 4.5.2

* Fixed a bug when using `bal.compute()` with a treatment variable with levels named "treated" and "control".
Expand All @@ -9,7 +21,7 @@

* Fixed a bug when using `addl` without a dataset supplied. (#71)

* Fixed a bug when using `subset` to remove clusters lack full representation in all treatment groups when `cluster` is specified. (#70)
* Fixed a bug when using `subset` to remove clusters lacking full representation in all treatment groups when `cluster` is specified. (#70)

# cobalt 4.5.1

Expand Down
54 changes: 33 additions & 21 deletions R/bal.compute.R
Expand Up @@ -336,19 +336,20 @@ init_smd <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL,
focal <- treat.all
}

if (is_null(focal) || pairwise) {
treatment.pairs <- combn(unique.treats, 2, simplify = FALSE)
}
else {
treatment.pairs <- lapply(setdiff(unique.treats, focal), c, focal)
treatment.pairs <- {
if (is_null(focal) || pairwise)
combn(unique.treats, 2, simplify = FALSE)
else
lapply(setdiff(unique.treats, focal), c, focal)
}
}
else {
treatment.pairs <- list(unique.treats)
pairwise <- TRUE
}

s.d.denom <- .get_s.d.denom(estimand = estimand, treat = treat, focal = focal, quietly = TRUE)
s.d.denom <- .get_s.d.denom(estimand = estimand, treat = treat,
focal = focal, quietly = TRUE)

denoms <- .compute_s.d.denom(x, treat = treat,
s.d.denom = s.d.denom,
Expand All @@ -363,6 +364,7 @@ init_smd <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL,
focal = focal,
pairwise = pairwise,
treatment.pairs = treatment.pairs)

class(out) <- "init_smd"
out
}
Expand Down Expand Up @@ -405,11 +407,11 @@ init_ks <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL, p
focal <- treat.all
}

if (is_null(focal) || pairwise) {
treatment.pairs <- combn(unique.treats, 2, simplify = FALSE)
}
else {
treatment.pairs <- lapply(setdiff(unique.treats, focal), c, focal)
treatment.pairs <- {
if (is_null(focal) || pairwise)
combn(unique.treats, 2, simplify = FALSE)
else
lapply(setdiff(unique.treats, focal), c, focal)
}
}
else {
Expand Down Expand Up @@ -469,11 +471,11 @@ init_ovl <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL,
focal <- treat.all
}

if (is_null(focal) || pairwise) {
treatment.pairs <- combn(unique.treats, 2, simplify = FALSE)
}
else {
treatment.pairs <- lapply(setdiff(unique.treats, focal), c, focal)
treatment.pairs <- {
if (is_null(focal) || pairwise)
combn(unique.treats, 2, simplify = FALSE)
else
lapply(setdiff(unique.treats, focal), c, focal)
}
}
else {
Expand All @@ -489,6 +491,7 @@ init_ovl <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL,
pairwise = pairwise,
treatment.pairs = treatment.pairs,
integrate = integrate)

class(out) <- "init_ovl"
out
}
Expand Down Expand Up @@ -534,11 +537,11 @@ init_ent <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL,
focal <- treat.all
}

if (is_null(focal) || pairwise) {
treatment.pairs <- combn(unique.treats, 2, simplify = FALSE)
}
else {
treatment.pairs <- lapply(setdiff(unique.treats, focal), c, focal)
treatment.pairs <- {
if (is_null(focal) || pairwise)
combn(unique.treats, 2, simplify = FALSE)
else
lapply(setdiff(unique.treats, focal), c, focal)
}
}
else {
Expand All @@ -554,6 +557,7 @@ init_ent <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NULL,
pairwise = pairwise,
treatment.pairs = treatment.pairs,
integrate = integrate)

class(out) <- "init_ent"
out
}
Expand Down Expand Up @@ -621,6 +625,7 @@ init_mahalanobis <- function(x, treat, s.weights = NULL, estimand = NULL, focal
s.weights = s.weights,
s.d.denom = s.d.denom,
sigma_inv = sigma_inv)

class(out) <- "init_mahalanobis"
out
}
Expand Down Expand Up @@ -709,6 +714,7 @@ init_energy.dist <- function(x, treat, s.weights = NULL, estimand = NULL, focal
treat = treat,
unique.treats = unique.treats,
focal = focal)

class(out) <- "init_energy.dist"
out
}
Expand Down Expand Up @@ -754,6 +760,7 @@ init_kernel.dist <- function(x, treat, s.weights = NULL, estimand = NULL, focal
T_star = T_star,
s.weights = s.weights,
treat = treat)

class(out) <- "init_kernel.dist"
out
}
Expand Down Expand Up @@ -786,6 +793,7 @@ init_p <- function(x, treat, s.weights = NULL, ...) {
bin.vars = bin.vars,
s.weights = s.weights,
s.d.denom = denoms)

class(out) <- "init_p"
out
}
Expand Down Expand Up @@ -823,6 +831,7 @@ init_s <- function(x, treat, s.weights = NULL, ...) {
bin.vars = bin.vars,
s.weights = s.weights,
s.d.denom = denoms)

class(out) <- "init_s"
out
}
Expand Down Expand Up @@ -855,6 +864,7 @@ init_r2 <- function(x, treat, s.weights = NULL, poly = 1, int = FALSE, ...) {
out <- list(treat = treat,
x = x,
s.weights = s.weights)

class(out) <- "init_r2"
out
}
Expand Down Expand Up @@ -901,6 +911,7 @@ init_distance.cov <- function(x, treat, s.weights = NULL, ...) {
out <- list(P = P,
s.weights = s.weights,
treat = treat)

class(out) <- "init_distance.cov"
out
}
Expand Down Expand Up @@ -1032,6 +1043,7 @@ init_l1.med <- function(x, treat, s.weights = NULL, estimand = NULL, focal = NUL
treat = treat,
unique.treats = unique.treats,
focal = focal)

class(out) <- "init_l1.med"
out

Expand Down

0 comments on commit 5c34204

Please sign in to comment.