ngreifer / WeightIt

WeightIt: an R package for propensity score weighting
https://ngreifer.github.io/WeightIt/
102 stars 13 forks source link

Warning message: deprecated when tidyverse loaded #22

Closed hail2thief closed 3 years ago

hail2thief commented 3 years ago

Seems totally minor since output doesn't actually change, but finding that I get a "deprecated" warning when: tidyverse is loaded + using the "cbps" method. PS: thanks for the awesome r package!

# read libraries
library(tidyverse)
library(WeightIt)
library(cobalt)
#>  cobalt (Version 4.2.2, Build Date: 2020-06-26 15:50:03 UTC)

# data
data("lalonde")

# example
out = weightit(treat ~ age + educ + married, data = lalonde, method = "cbps")
#> Warning: Deprecated
summary(out)
#>                  Summary of weights
#> 
#> - Weight ranges:
#> 
#>            Min                                  Max
#> treated 2.2741      |----------------------| 6.9730
#> control 1.1645 |-|                           1.8046
#> 
#> - Units with 5 greatest weights by group:
#>                                            
#>             182    177    167    124     38
#>  treated 6.8991 6.9129 6.9267 6.9274  6.973
#>             604    589    572    541    531
#>  control 1.7794 1.7807 1.7907 1.7985 1.8046
#> 
#> - Weight statistics:
#> 
#>         Coef of Var   MAD Entropy # Zeros
#> treated       0.527 0.411   1.288       0
#> control       0.185 0.184   0.377       0
#> overall       0.641 0.384   0.826       0
#> 
#> - Effective Sample Sizes:
#> 
#>            Control Treated
#> Unweighted  429.    185.  
#> Weighted    414.87  144.95

Created on 2021-03-31 by the reprex package (v0.3.0)

ngreifer commented 3 years ago

Thank you for letting me know about this! It is definitely a strange issue, but I have figured out the cause. Trying to find a good solution to it now. You can safely ignore the warning.

ngreifer commented 3 years ago

Figured it out and fixed it. The new version of WeightIt is now on CRAN.