ngreifer / optweight Goto Github PK
View Code? Open in Web Editor NEWR package for estimating balancing weights using optimization
Home Page: https://ngreifer.github.io/optweight/
R package for estimating balancing weights using optimization
Home Page: https://ngreifer.github.io/optweight/
Is it possible to extract the dual parameters, i.e. \lambda^\dagger from Theorem 1 here
I ran into an convergence issue trying SBW on a dataset of mine, which seems size related, once âĽN samples (dependent on the treatment distribution?), optweight fails to converge.
library(optweight)
library(WeightIt)
testdf = readRDS("ow_test.rds")
optweight(trt ~ age, data=testdf, estimand = "ATE") # fails
optweight(trt ~ age, data=testdf[1:16765,], estimand = "ATE") # runs
optweight(trt ~ age, data=testdf[1:16766,], estimand = "ATE") # fails
weightit(trt ~ age, data=testdf, method = "ebal", estimand = "ATE")
data("lalonde", package = "cobalt")
set.seed(123)
lalonde_dup = lalonde[sample(nrow(lalonde), 50000, replace = T),]
optweight(treat ~ age + educ + married + nodegree + re74, # original
data = lalonde, tols = .01, estimand = "ATE")
optweight(treat ~ age + educ + married + nodegree + re74, # fails
data = lalonde_dup, tols = .01, estimand = "ATE")
optweight(treat ~ age + educ + married + nodegree + re74, # success
data = lalonde_dup[1:14339,], tols = .01, estimand = "ATE")
optweight(treat ~ age + educ + married + nodegree + re74, # fails
data = lalonde_dup[1:14340,], tols = .01, estimand = "ATE")
optweight(treat ~ age, # continues to fail despite simplification
data = lalonde_dup[1:14340,], tols = .01, estimand = "ATE")
> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] WeightIt_0.14.2 optweight_0.2.5
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 rstudioapi_0.14 magrittr_2.0.1 cobalt_4.5.1 tidyselect_1.1.1 munsell_0.5.0 colorspace_2.0-3 lattice_0.20-44
[9] R6_2.5.1 rlang_1.1.1 fansi_0.5.0 dplyr_1.0.7 tools_4.0.5 grid_4.0.5 gtable_0.3.1 osqp_0.6.0.8
[17] utf8_1.2.2 cli_3.4.1 ellipsis_0.3.2 tibble_3.1.4 lifecycle_1.0.3 crayon_1.4.1 Matrix_1.3-4 purrr_0.3.4
[25] ggplot2_3.4.2 vctrs_0.6.3 glue_1.4.2 compiler_4.0.5 pillar_1.6.2 chk_0.9.0 backports_1.4.1 generics_0.1.0
[33] scales_1.2.1 pkgconfig_2.0.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. đđđ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google â¤ď¸ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.