Package: natstrat 2.0.0
natstrat: Obtain Unweighted Natural Strata that Balance Many Covariates
Natural strata can be used in observational studies to balance the distributions of many covariates across any number of treatment groups and any number of comparisons. These strata have proportional amounts of units within each stratum across the treatments, allowing for simple interpretation and aggregation across strata. Within each stratum, the units are chosen using randomized rounding of a linear program that balances many covariates. To solve the linear program, the 'Gurobi' commercial optimization software is recommended, but not required. The 'gurobi' R package can be installed following the instructions at <https://www.gurobi.com/documentation/9.1/refman/ins_the_r_package.html>.
Authors:
natstrat_2.0.0.tar.gz
natstrat_2.0.0.zip(r-4.5)natstrat_2.0.0.zip(r-4.4)natstrat_2.0.0.zip(r-4.3)
natstrat_2.0.0.tgz(r-4.4-any)natstrat_2.0.0.tgz(r-4.3-any)
natstrat_2.0.0.tar.gz(r-4.5-noble)natstrat_2.0.0.tar.gz(r-4.4-noble)
natstrat_2.0.0.tgz(r-4.4-emscripten)natstrat_2.0.0.tgz(r-4.3-emscripten)
natstrat.pdf |natstrat.html✨
natstrat/json (API)
NEWS
# Install 'natstrat' in R: |
install.packages('natstrat', repos = c('https://kkbrum.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/kkbrum/natstrat/issues
- nh0506 - Homocysteine and smoking example data
- nh0506_3groups - Homocysteine and smoking example data with multiple control groups
Last updated 3 years agofrom:92d452124e. Checks:OK: 1 NOTE: 6. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Oct 11 2024 |
R-4.5-win | NOTE | Oct 11 2024 |
R-4.5-linux | NOTE | Oct 11 2024 |
R-4.4-win | NOTE | Oct 11 2024 |
R-4.4-mac | NOTE | Oct 11 2024 |
R-4.3-win | NOTE | Oct 11 2024 |
R-4.3-mac | NOTE | Oct 11 2024 |
Exports:check_balancecreate_dist_matrixgenerate_constraintsgenerate_qsoptimize_controlsstand
Dependencies:caretclasscliclockcodetoolscolorspacecpp11data.tablediagramdigestdplyre1071fansifarverforeachfuturefuture.applygenericsggplot2globalsgluegowergtablehardhatipredisobanditeratorsKernSmoothlabelinglatticelavalifecyclelistenvlpSolvelubridatemagrittrMASSMatrixmgcvModelMetricsmunsellnlmennetnumDerivparallellypillarpkgconfigplyrppspROCprodlimprogressrproxypurrrR6ramifyRColorBrewerRcpprecipesreshape2RglpkrlangrpartsamplingscalesshapeslamSQUAREMstringistringrsurvivaltibbletidyrtidyselecttimechangetimeDatetzdbutf8vctrsviridisLitewithr
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Check covariate balance of the control and treated groups | check_balance |
Create matrix of distances between strata | create_dist_matrix |
Generate constraints to encourage covariate balance | generate_constraints |
Calculate desired number of controls per stratum | generate_qs |
Homocysteine and smoking example data | nh0506 |
Homocysteine and smoking example data with multiple control groups | nh0506_3groups |
Select control units that optimize covariate balance | optimize_controls |
Standardize covariate vector for balance constraint | stand |