Skip to content

Commit

Permalink
version 3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ngreifer authored and cran-robot committed Sep 15, 2018
1 parent f61cd3d commit 4bd158b
Show file tree
Hide file tree
Showing 18 changed files with 581 additions and 492 deletions.
7 changes: 3 additions & 4 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: cobalt
Title: Covariate Balance Tables and Plots
Version: 3.4.0
Version: 3.4.1
Author: Noah Greifer [aut, cre]
Maintainer: Noah Greifer <noah.greifer@gmail.com>
Description: Generate balance tables and plots for covariates of groups preprocessed through matching, weighting or subclassification, for example, using propensity scores. Includes integration with 'MatchIt', 'twang', 'Matching', 'optmatch', 'CBPS', 'ebal', 'WeightIt', and 'designmatch' for assessing balance on the output of their preprocessing functions. Users can also specify data for balance assessment not generated through the above packages. Also included are methods for assessing balance in clustered or multiply imputed data sets or data sets with longitudinal treatments.
Expand All @@ -11,12 +11,11 @@ Suggests: MatchIt, WeightIt (>= 0.3.0), twang, Matching, optmatch,
License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
Date: 2018-08-12
VignetteBuilder: knitr
URL: https://github.com/ngreifer/cobalt
BugReports: https://github.com/ngreifer/cobalt/issues
RoxygenNote: 6.0.1
NeedsCompilation: no
Packaged: 2018-08-13 16:57:36 UTC; NoahGreifer
Packaged: 2018-09-14 21:44:48 UTC; NoahGreifer
Repository: CRAN
Date/Publication: 2018-08-14 04:20:07 UTC
Date/Publication: 2018-09-15 07:20:02 UTC
34 changes: 17 additions & 17 deletions MD5
@@ -1,30 +1,30 @@
533db5bdeb0d7f9914102e05d4f2d9d4 *DESCRIPTION
27716d003ba1c832ad0c5495167e54ef *DESCRIPTION
8c75818892d88aadbbe83600d5684433 *NAMESPACE
98827f0b211b89f97c0c65fb0593bae9 *NEWS.md
d902dd594c5f1bab61455586c47bce6a *R/bal.plot.R
e5b9cc4fd07f2abc44b05a0d40fb846e *R/bal.tab.R
778b2d197ae618b70e0db90e662e4c5c *R/functions_for_processing.R
5734eb96fa85a4877655b520c63787e8 *NEWS.md
2a7afa56a30528f58a3be3506bb10eec *R/bal.plot.R
86a034282be87063cc70feaa6607bb20 *R/bal.tab.R
252f00c539c595b16ee0938a76f896cb *R/functions_for_processing.R
111c6a2e0a2855dddb82c83cbbfd8a4a *R/love.plot.R
d6a0599bb4656e35823f7fc5e596d7ae *R/print.bal.tab.R
3e312a8646fcdc606cc5bfaf2b91a863 *R/utilities.R
0069a58c5341c762a8f1a6f113ca0359 *R/x2base.R
1cd1d7409f193af8312ff0fa39d960c2 *R/print.bal.tab.R
24d0ea8c0ffb311c6b93aaace001e9de *R/utilities.R
6ed2b9aa25ffdce5485064ee239d8b06 *R/x2base.R
0230929ebe6a272d2311fcb946c97905 *README.md
7c338a77747e25ff93f0ddd4a7ac32c2 *build/partial.rdb
b5884e50d0bccdd21a693827846a5b07 *build/partial.rdb
a68a3a523252ed2db3875ef7f896471a *build/vignette.rds
949b492287de79b9a90d520db98768c1 *data/lalonde.RData
d22e5afa667cdc190e348ae984c830a2 *data/lalonde_mis.RData
ac2fe583baedeb21fb9ee6b150a3b1be *inst/doc/cobalt_A0_basic_use.R
e96cf4b6e3d73ddb02b76015e9b4dc82 *inst/doc/cobalt_A0_basic_use.Rmd
55f4db95f468a74dc23096b7ae5d8093 *inst/doc/cobalt_A0_basic_use.html
99c19c1af0dcbf3e284b05847a5cc0fb *inst/doc/cobalt_A0_basic_use.Rmd
c05df2da2707ec076d993cab2cb2da0f *inst/doc/cobalt_A0_basic_use.html
e767c6ba0dc0e71cc6ff9f796f072eeb *inst/doc/cobalt_A1_other_packages.R
595fcd32fc888e345d5e67efde1c2dbd *inst/doc/cobalt_A1_other_packages.Rmd
e1f756bac0217363606087000b3acd3c *inst/doc/cobalt_A1_other_packages.html
3cc4b286972ee52d62e019824b5efabb *inst/doc/cobalt_A1_other_packages.html
1e55dd7772ee036af5b6c1396441f22e *inst/doc/cobalt_A2_cluster_imp.R
b38661cc43d2f62eb39b4c0213e86072 *inst/doc/cobalt_A2_cluster_imp.Rmd
0df946a683b4b5481c3ce31227e47eb0 *inst/doc/cobalt_A2_cluster_imp.html
c8cd44e4816aba3878c0bac23eab91c2 *inst/doc/cobalt_A2_cluster_imp.html
8c429299d3a0b9e1d5b61fd3cf3d2d58 *inst/doc/cobalt_A3_longitudinal_treat.R
f88d8c92fbc7efa42ea3d78ea86c7fa3 *inst/doc/cobalt_A3_longitudinal_treat.Rmd
e450d82bc548895d3c04435c7e9e6eda *inst/doc/cobalt_A3_longitudinal_treat.html
89c91cc12d9bc70d86d02574f99bde26 *inst/doc/cobalt_A3_longitudinal_treat.html
324de8fe4c2c8ce07434ae41b018702f *inst/figures/README-unnamed-chunk-3-1.png
5337340e8d5bbd86e9fa43c6ec979374 *inst/figures/README-unnamed-chunk-3-2.png
797f8b0a88cb066430299b3ae748efa8 *inst/figures/README-unnamed-chunk-3-3.png
Expand All @@ -39,7 +39,7 @@ df088bd45c3d27a6c67789e2cb5e91be *man/bal.tab.Match.Rd
2de1cc4f94dc2e9ae09a3693dff1adba *man/bal.tab.ebalance.Rd
441501808092f72f6ba00e7567651ad3 *man/bal.tab.matchit.Rd
91e4418dfdb66884c5ae00735a3ba1d9 *man/bal.tab.optmatch.Rd
889b7bf958ee43c68ea4cd6f3ec91df0 *man/bal.tab.ps.Rd
999ee9c279c23a259faaaca37c8b9efe *man/bal.tab.ps.Rd
14a510451ff0acad0ee8d470adc12040 *man/bal.tab.time.list.Rd
8e89806bcdc2a23bd3c7b8829f8aee0c *man/bal.tab.weightit.Rd
5393b869fd5241a0b67a953d0bfd50eb *man/class-bal.tab.cluster.Rd
Expand All @@ -52,9 +52,9 @@ a08ee89605f037da64ad5c71d24badec *man/f.build.Rd
e43b36b1df7ae5954e88f78eeb9d7f87 *man/lalonde.Rd
fc26c4cd0a640103df0cac2cff089acb *man/love.plot.Rd
d0d0bd8d571d0607a4066347fb32620c *man/print.bal.tab.Rd
969532fe9e9ee03bfb532d4255a2f49b *man/splitfactor.Rd
4650b55c6932be5377877a1fa960cb6e *man/splitfactor.Rd
886f4a717e9a135f5f58ddc1db2e8dee *man/var.names.Rd
e96cf4b6e3d73ddb02b76015e9b4dc82 *vignettes/cobalt_A0_basic_use.Rmd
99c19c1af0dcbf3e284b05847a5cc0fb *vignettes/cobalt_A0_basic_use.Rmd
595fcd32fc888e345d5e67efde1c2dbd *vignettes/cobalt_A1_other_packages.Rmd
b38661cc43d2f62eb39b4c0213e86072 *vignettes/cobalt_A2_cluster_imp.Rmd
f88d8c92fbc7efa42ea3d78ea86c7fa3 *vignettes/cobalt_A3_longitudinal_treat.Rmd
22 changes: 20 additions & 2 deletions NEWS.md
@@ -1,6 +1,24 @@
cobalt News and Updates
======

Version 3.4.1

* Fixed a bug that would occur when `imabalanced.only = TRUE` in `bal.tab` but all variables were balanced.

* Fixed a bug where the mean of a binary variable would be displayed as 1 minus its mean.

* Fixed a bug that would occur when missingness patterns were the same for multiple variables.

* Fixed a bug that would occur when a distance measure was to be assessed with `bal.tab` and there were missing values in the covariates (thanks to Laura Helmkamp).

* Fixed a bug that would occur when `estimand` was supplied by the user when using the `default` method of `bal.tab`.

* Fixed a bug where non-standard variable names (like `"I(age^2)"`) would cause an error.

* Fixed a bug where treatment levels that had different numbers of characters would yield an error.

* Added `disp.means` option to `bal.tab` with continuous treatments.

Version 3.4.0

* Added `default` method for `bal.tab` so it can be used with specially formatted output from other packages (e.g., from `optweight`). `bal.plot` should work with these outputs too. This, of course, will never be completely bug-free because infinite inputs are possible and cannot all be processed perfectly. Don't try to break this function :)
Expand All @@ -17,7 +35,7 @@ Version 3.4.0

* Added `var.names` function to extract and save variable names from `bal.tab` objects. This makes it a lot easier to create replacement names for use in `love.plot`. Thanks to @victorn1 for the suggestion.

* When weighted correlations are computed for continuous treatments, the denominator of the correlation uses the unweighted standard deviations. See `?bal.tab` for the rationale.
* When weighted correlations are computed for continuous treatments, the denominator of the correlation now uses the unweighted standard deviations. See `?bal.tab` for the rationale.

Version 3.3.0

Expand All @@ -31,7 +49,7 @@ Version 3.3.0

* Added `subset` option in all `bal.tab()` methods (and consequently in `bal.plot()`) that allows users to specify a subset of the data to assess balance on (i.e., instead of the whole data set). This provides a workaround for methods were the `cluster` option isn't allowed (e.g., longitudinal treatments) but balance is desired on subsets of the data. However, in most cases, `cluster` with `which.cluster` specified makes more sense.

* Updated help files, in particularly more clearly documenting methods for `iptw` objects from `twang` and `CBMSM` objects from `CBPS`.
* Updated help files, in particular, more clearly documenting methods for `iptw` objects from `twang` and `CBMSM` objects from `CBPS`.

* Added pretty printing with `crayon`, inspired by Jacob Long's `jtools` package

Expand Down
10 changes: 5 additions & 5 deletions R/bal.plot.R
Expand Up @@ -28,7 +28,7 @@ bal.plot <- function(obj, var.name, ..., which, which.sub = NULL, cluster = NULL
}
if (all(sapply(var.list, is_null))) stop(paste0("\"", var.name, "\" is not the name of a variable in any available data set input."), call. = FALSE)
X$var <- unlist(var.list[appears.in.time])
X$time <- rep(seq_along(X$covs.list)[appears.in.time], each = nrow(X$covs.list[[1]]))
X$time <- rep(seq_along(X$covs.list)[appears.in.time], each = NROW(X$covs.list[[1]]))
X$treat <- unlist(X$treat.list[appears.in.time])
if (is_not_null(names(X$treat.list))) treat.names <- names(X$treat.list)
else treat.names <- seq_along(X$treat.list)
Expand Down Expand Up @@ -93,7 +93,7 @@ bal.plot <- function(obj, var.name, ..., which, which.sub = NULL, cluster = NULL
in.sub <- !is.na(X$subclass) & X$subclass %in% which.sub
D <- setNames(as.data.frame(matrix(0, nrow = sum(in.sub), ncol = 4)),
c("weights", "treat", "var", "subclass"))
D$weights <- rep(1, nrow(D))
D$weights <- rep(1, NROW(D))
D$treat <- X$treat[in.sub]
D$var <- X$var[in.sub]
D$subclass <- paste("Subclass", X$subclass[in.sub])
Expand All @@ -107,7 +107,7 @@ bal.plot <- function(obj, var.name, ..., which, which.sub = NULL, cluster = NULL
if (which == "both") {
D2 <- setNames(as.data.frame(matrix(0, nrow = length(X$treat), ncol = 4)),
c("weights", "treat", "var", "subclass"))
D2$weights <- rep(1, nrow(D2))
D2$weights <- rep(1, NROW(D2))
D2$treat <- X$treat
D2$var <- X$var
D2$subclass <- rep("Unadjusted Sample", length(X$treat))
Expand Down Expand Up @@ -308,7 +308,7 @@ bal.plot <- function(obj, var.name, ..., which, which.sub = NULL, cluster = NULL

if (is.categorical.var) { #Categorical vars
d$var <- factor(d$var)
cat.sizes <- tapply(rep(1, nrow(d)), d$var, sum)
cat.sizes <- tapply(rep(1, NROW(d)), d$var, sum)
smallest.cat <- names(cat.sizes)[which.min(cat.sizes)]
if (is.character(bw)) {
if (is.function(get0(paste0("bw.", bw)))) {
Expand Down Expand Up @@ -436,7 +436,7 @@ bal.plot <- function(obj, var.name, ..., which, which.sub = NULL, cluster = NULL
geom_hline(yintercept = 0)
}
else { #Continuous vars
t.sizes <- tapply(rep(1, nrow(d)), d$treat, sum)
t.sizes <- tapply(rep(1, NROW(d)), d$treat, sum)
smallest.t <- names(t.sizes)[which.min(t.sizes)]
if (is.character(bw)) {
if (is.function(get0(paste0("bw.", bw)))) {
Expand Down

0 comments on commit 4bd158b

Please sign in to comment.