From 798fb162f8b832ceaa5b4647d7d1ec1a795b31bb Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Sun, 5 Jan 2025 10:31:15 +0000 Subject: [PATCH] refresh package; fix #24; fix #25; fix #26; fix #28 --- .Rbuildignore | 2 + .github/CONTRIBUTING.MD | 43 - .github/CONTRIBUTING.md | 32 + .github/ISSUE_TEMPLATE.md | 25 - .../{check-standard.yaml => R-CMD-check.yaml} | 25 +- .github/workflows/netlify.yaml | 53 ++ .github/workflows/pkgdown.yaml | 49 ++ .github/workflows/test-coverage.yaml | 47 +- .gitignore | 4 + DESCRIPTION | 13 +- R/bbw.R | 80 +- R/bootBW.r | 7 +- R/bootClassic.R | 8 +- R/bootProbit.R | 2 +- R/recode.R | 8 +- README.Rmd | 52 +- README.md | 124 ++- docs/404.html | 66 +- docs/CODE_OF_CONDUCT.html | 54 +- docs/ISSUE_TEMPLATE.html | 98 --- docs/LICENSE-text.html | 797 ------------------ docs/LICENSE.html | 92 +- docs/NEWS.html | 142 ---- docs/README.html | 148 ---- docs/apple-touch-icon.png | Bin 27972 -> 18055 bytes docs/articles/bbw.html | 154 +--- docs/articles/index.html | 53 +- docs/authors.html | 73 +- docs/bootstrap-toc.css | 60 -- docs/bootstrap-toc.js | 159 ---- docs/cran-comments.html | 150 ---- .../bootstrap-5.1.0/bootstrap.bundle.min.js | 7 - .../bootstrap.bundle.min.js.map | 1 - docs/deps/bootstrap-5.1.0/bootstrap.min.css | 1 - docs/deps/bootstrap-5.1.0/font.css | 14 - ...txg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff | Bin 26128 -> 0 bytes ...txg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff | Bin 25804 -> 0 bytes .../fonts/4iCs6KVjbNBYlgo6ew.woff | Bin 133368 -> 0 bytes .../fonts/4iCs6KVjbNBYlgoKfw7w.woff | Bin 39164 -> 0 bytes .../fonts/4iCv6KVjbNBYlgoCxCvTtA.woff | Bin 116784 -> 0 bytes .../fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff | Bin 33424 -> 0 bytes .../6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff | Bin 19368 -> 0 bytes .../6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff | Bin 39572 -> 0 bytes .../fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff | Bin 81008 -> 0 bytes .../6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff | Bin 20180 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff | Bin 80556 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff | Bin 80084 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff | Bin 19896 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff | Bin 80588 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff | Bin 20204 -> 0 bytes .../fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff | Bin 16692 -> 0 bytes .../fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff | Bin 29712 -> 0 bytes .../fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff | Bin 75144 -> 0 bytes .../fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff | Bin 16424 -> 0 bytes .../fonts/JTURjIg1_i6t8kCHKm45_ZpC7g0.woff | Bin 68108 -> 0 bytes .../fonts/JTURjIg1_i6t8kCHKm45_dJE7g0.woff | Bin 68180 -> 0 bytes .../fonts/JTUSjIg1_i6t8kCHKm45xW0.woff | Bin 68308 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff | Bin 20532 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmEU9vAA.woff | Bin 65492 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff | Bin 20404 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmSU5vAA.woff | Bin 64952 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff | Bin 20396 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmWUlvAA.woff | Bin 65292 -> 0 bytes .../fonts/KFOmCnqEu92Fr1Me5g.woff | Bin 65244 -> 0 bytes .../fonts/KFOmCnqEu92Fr1Mu4mxM.woff | Bin 20332 -> 0 bytes .../fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff | Bin 89708 -> 0 bytes .../fonts/S6u8w4BMUTPHjxsAXC-s.woff | Bin 29836 -> 0 bytes .../fonts/S6u8w4BMUTPHjxswWA.woff | Bin 35444 -> 0 bytes .../fonts/S6u9w4BMUTPHh6UVSwiPHw.woff | Bin 28052 -> 0 bytes .../fonts/S6u9w4BMUTPHh6UVeww.woff | Bin 33380 -> 0 bytes .../fonts/S6u9w4BMUTPHh7USSwiPHw.woff | Bin 30024 -> 0 bytes .../fonts/S6u9w4BMUTPHh7USeww.woff | Bin 35168 -> 0 bytes .../fonts/S6uyw4BMUTPHjx4wWA.woff | Bin 28660 -> 0 bytes .../fonts/S6uyw4BMUTPHvxo.woff | Bin 34040 -> 0 bytes ...HuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff | Bin 132068 -> 0 bytes ...HuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff | Bin 130576 -> 0 bytes ...HuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff | Bin 121716 -> 0 bytes .../fonts/XRXV3I6Li01BKof4MQ.woff | Bin 63952 -> 0 bytes .../fonts/XRXW3I6Li01BKofA6sKkZQ.woff | Bin 64560 -> 0 bytes .../fonts/XRXW3I6Li01BKofAjsOkZQ.woff | Bin 63804 -> 0 bytes ...SCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff | Bin 21848 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff | Bin 74640 -> 0 bytes ...SCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff | Bin 21780 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff | Bin 74512 -> 0 bytes ...SCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff | Bin 21168 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff | Bin 71656 -> 0 bytes ...X2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff | Bin 20100 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff | Bin 68596 -> 0 bytes ...X2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff | Bin 20684 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff | Bin 70456 -> 0 bytes ...X2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff | Bin 20640 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff | Bin 70736 -> 0 bytes .../fonts/pe03MImSLYBIv1o4X1M8cc9iB_5p.woff | Bin 57672 -> 0 bytes .../fonts/pe0qMImSLYBIv1o4X1M8cfe5.woff | Bin 57300 -> 0 bytes .../fonts/q5uGsou0JOdh94bfvQlr.woff | Bin 31624 -> 0 bytes docs/deps/data-deps.txt | 13 +- docs/docsearch.css | 148 ---- docs/docsearch.js | 85 -- docs/favicon.ico | Bin 15086 -> 15086 bytes docs/index.html | 162 ++-- docs/jquery.sticky-kit.min.js | 11 - docs/man/figures/rouletteWheel.png | Bin 117286 -> 0 bytes docs/news/index.html | 67 +- docs/pkgdown.css | 367 -------- docs/pkgdown.js | 16 +- docs/pkgdown.yml | 7 +- docs/reference/Rplot001.png | Bin 1011 -> 0 bytes docs/reference/bbw.html | 142 ++-- docs/reference/bootBW.html | 132 +-- docs/reference/bootClassic.html | 73 +- docs/reference/bootPROBIT.html | 82 +- docs/reference/figures/analytics.png | Bin 16747 -> 0 bytes docs/reference/index.html | 170 ++-- docs/reference/indicatorsCH1.html | 63 +- docs/reference/indicatorsCH2.html | 63 +- docs/reference/indicatorsHH.html | 63 +- docs/reference/recode.html | 212 +++-- docs/reference/villageData.html | 63 +- docs/search.json | 2 +- docs/sitemap.xml | 92 +- man/bbw.Rd | 79 +- man/bootBW.Rd | 2 +- man/bootClassic.Rd | 3 +- man/recode.Rd | 8 +- pkgdown/_pkgdown.yml | 49 +- pkgdown/favicon/apple-touch-icon.png | Bin 27972 -> 18055 bytes pkgdown/favicon/favicon-96x96.png | Bin 0 -> 7739 bytes pkgdown/favicon/favicon.ico | Bin 15086 -> 15086 bytes pkgdown/favicon/favicon.svg | 3 + pkgdown/favicon/site.webmanifest | 21 + pkgdown/favicon/web-app-manifest-192x192.png | Bin 0 -> 19965 bytes pkgdown/favicon/web-app-manifest-512x512.png | Bin 0 -> 100530 bytes vignettes/bbw.Rmd | 2 +- 133 files changed, 1274 insertions(+), 3569 deletions(-) delete mode 100644 .github/CONTRIBUTING.MD create mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/ISSUE_TEMPLATE.md rename .github/workflows/{check-standard.yaml => R-CMD-check.yaml} (59%) create mode 100644 .github/workflows/netlify.yaml create mode 100644 .github/workflows/pkgdown.yaml delete mode 100644 docs/ISSUE_TEMPLATE.html delete mode 100644 docs/LICENSE-text.html delete mode 100644 docs/NEWS.html delete mode 100644 docs/README.html delete mode 100644 docs/bootstrap-toc.css delete mode 100644 docs/bootstrap-toc.js delete mode 100644 docs/cran-comments.html delete mode 100644 docs/deps/bootstrap-5.1.0/bootstrap.bundle.min.js delete mode 100644 docs/deps/bootstrap-5.1.0/bootstrap.bundle.min.js.map delete mode 100644 docs/deps/bootstrap-5.1.0/bootstrap.min.css delete mode 100644 docs/deps/bootstrap-5.1.0/font.css delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/4iCs6KVjbNBYlgo6ew.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/4iCs6KVjbNBYlgoKfw7w.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/4iCv6KVjbNBYlgoCxCvTtA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/JTURjIg1_i6t8kCHKm45_ZpC7g0.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/JTURjIg1_i6t8kCHKm45_dJE7g0.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/JTUSjIg1_i6t8kCHKm45xW0.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmEU9vAA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmSU5vAA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmWUlvAA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOmCnqEu92Fr1Me5g.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/KFOmCnqEu92Fr1Mu4mxM.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6u8w4BMUTPHjxsAXC-s.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6u8w4BMUTPHjxswWA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh6UVSwiPHw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh6UVeww.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh7USSwiPHw.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh7USeww.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6uyw4BMUTPHjx4wWA.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/S6uyw4BMUTPHvxo.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/XRXV3I6Li01BKof4MQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/XRXW3I6Li01BKofA6sKkZQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/XRXW3I6Li01BKofAjsOkZQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/pe03MImSLYBIv1o4X1M8cc9iB_5p.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/pe0qMImSLYBIv1o4X1M8cfe5.woff delete mode 100644 docs/deps/bootstrap-5.1.0/fonts/q5uGsou0JOdh94bfvQlr.woff delete mode 100644 docs/docsearch.css delete mode 100644 docs/docsearch.js delete mode 100644 docs/jquery.sticky-kit.min.js delete mode 100644 docs/man/figures/rouletteWheel.png delete mode 100644 docs/pkgdown.css delete mode 100644 docs/reference/Rplot001.png delete mode 100644 docs/reference/figures/analytics.png create mode 100644 pkgdown/favicon/favicon-96x96.png create mode 100644 pkgdown/favicon/favicon.svg create mode 100644 pkgdown/favicon/site.webmanifest create mode 100644 pkgdown/favicon/web-app-manifest-192x192.png create mode 100644 pkgdown/favicon/web-app-manifest-512x512.png diff --git a/.Rbuildignore b/.Rbuildignore index 3b5e85f..315abd1 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -18,3 +18,5 @@ ^codecov\.yml$ ^pkgdown$ ^CRAN-SUBMISSION$ +^README\.html$ +^CODE_OF_CONDUCT\.md$ diff --git a/.github/CONTRIBUTING.MD b/.github/CONTRIBUTING.MD deleted file mode 100644 index 32a791d..0000000 --- a/.github/CONTRIBUTING.MD +++ /dev/null @@ -1,43 +0,0 @@ -# Contributing - -When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with [Ernest Guevarra](mailto:ernest@guevarra.io) repository before making a change. - -Please note we have a [code of conduct](https://github.com/rapidsurveys/bbw/blob/master/.github/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project. - -
- -## How to make a clean pull request - -* Create a personal fork of this project on Github. - -* Clone the fork on your local machine. Your remote repo on Github is called `origin`. - -* Add the original repository as a remote called `upstream`. - -* If you created your fork a while ago be sure to pull upstream changes into your local repository. - -* Create a new branch to work on! Branch from `development`. - -* Implement/fix your feature, comment your code. - -* Follow the code style of the project, including indentation. - -* Add or change the documentation as needed. - -* Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary. - -* Push your branch to your fork on Github, the remote `origin`. - -* From your fork open a pull request in the correct branch using the specified [Pull Request Template](https://github.com/rapidsurveys/bbw/blob/master/.github/PULL_REQUEST_TEMPLATE.md). Target this project's `development` branch. - -* Update the `README.md` with details of changes to the interface particularly changes in how indicators are defined or addition of new indicators. - -* Increase the version numbers in any examples files and the `README.md` to the new version that this `Pull Request` would represent. The versioning scheme we use is [SemVer](http://semver.org/). - -* You may then request [Ernest Guevarra](mailto:ernest@guevarra.io) to merge your `Pull Request` for you. - -* Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete -your extra branch(es). - -* And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..079bf1f --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +## Bugs + +* Submit an issue on the [issues page](https://github.com/rapidsurveys/bbw/issues) + +## Code contributions + +* Fork this repository to your Github account + +* Clone your version on your account down to your machine from your account + +``` +git clone https://github.com//bbw.git +``` + +* Make sure to track progress upstream i.e., on our version of `bbw` +at `rapidsurveys/bbw`, by doing + +``` +git remote add upstream https://github.com/rapidsurveys/bbw.git +``` + +* Before making changes make sure to pull changes in from `upstream` by doing either `git fetch upstream` then merge later or `git pull upstream` to fetch and merge in one step + +* Make your changes on a new feature branch + +* Please write a test or tests for your changes if they affect code and not just documentation + +* Push up changes to your account + +* Submit a pull request at `rapidsurveys/bbw` diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3e28e50..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,25 +0,0 @@ -[provide general introduction to the issue logging and why it is relevant to this repository] - - -## Context -[provide more detailed introduction to the issue itself and why it is relevant] - - -## Process -[ordered list the process to finding and recreating the issue, example below] - - -## Expected result -[describe what you would expect to have resulted from this process] - - -## Current result -[describe what you you currently experience from this process, and thereby explain the bug] - - -## Possible Fix -[not obligatory, but suggest fixes or reasons for the bug] - - -## `name of issue` screenshot -[if relevant, include a screenshot] diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/R-CMD-check.yaml similarity index 59% rename from .github/workflows/check-standard.yaml rename to .github/workflows/R-CMD-check.yaml index 271d466..562fe0f 100644 --- a/.github/workflows/check-standard.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,12 +1,13 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] pull_request: - branches: [main, master] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: @@ -18,7 +19,7 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} @@ -29,18 +30,22 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: rcmdcheck + extra-packages: any::rcmdcheck + needs: check - - uses: r-lib/actions/check-r-package@v1 + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml new file mode 100644 index 0000000..10c6fe1 --- /dev/null +++ b/.github/workflows/netlify.yaml @@ -0,0 +1,53 @@ +on: + pull_request: + branches: [main, master] + +name: pkgdown-pr + +jobs: + netlify: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-tinytex@v2 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Install package + run: R CMD INSTALL . + + - name: Create website + run: | + pkgdown::build_site() + shell: Rscript {0} + + - name: Create index file + run: | + echo ' ' > ./docs/index.html + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v3.0 + with: + publish-dir: './docs' + production-branch: main + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: + 'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' + # these default to 'true' + enable-commit-comment: false + enable-github-deployment: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..bfc9f4d --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 3c0da1c..e050312 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,12 +1,13 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] pull_request: - branches: [main, master] -name: test-coverage +name: test-coverage.yaml + +permissions: read-all jobs: test-coverage: @@ -15,16 +16,46 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: covr + extra-packages: any::covr, any::xml2 + needs: coverage - name: Test coverage - run: covr::codecov() + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + covr::to_cobertura(cov) shell: Rscript {0} + + - uses: codecov/codecov-action@v4 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.gitignore b/.gitignore index c5f9a5e..38138ee 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ /revdep/data.sqlite /revdep/library /revdep/library.noindex + +README.html +/docs/ +docs diff --git a/DESCRIPTION b/DESCRIPTION index 2f0cb3d..883ceab 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,12 @@ Package: bbw Type: Package Title: Blocked Weighted Bootstrap -Version: 0.2.0 +Version: 0.2.1.9000 Authors@R: c( - person("Mark", "Myatt", email = "mark@brixtonhealth.com", role = "aut"), + person("Mark", "Myatt", + email = "mark@brixtonhealth.com", role = c("aut", "cph")), person("Ernest", "Guevarra", comment = c(ORCID = "0000-0002-4887-4415"), - email = "ernestgmd@gmail.com", role = c("aut", "cre"))) + email = "ernestgmd@gmail.com", role = c("aut", "cre", "cph"))) Description: The blocked weighted bootstrap (BBW) is an estimation technique for use with data from two-stage cluster sampled surveys in which either prior weighting (e.g. population-proportional sampling or PPS as used in @@ -17,22 +18,22 @@ Description: The blocked weighted bootstrap (BBW) is an estimation technique and Aaron et al (2016) for application of the blocked weighted bootstrap to estimate indicators from two-stage cluster sampled surveys. +License: GPL-3 +Depends: R (>= 3.0.1) Imports: car, withr -Depends: R (>= 3.0.1) Suggests: knitr, rmarkdown, testthat, spelling, covr -License: GPL-3 Encoding: UTF-8 Language: en-GB LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 +RoxygenNote: 7.3.2 URL: https://github.com/rapidsurveys/bbw, https://rapidsurveys.io/bbw/ BugReports: https://github.com/rapidsurveys/bbw/issues VignetteBuilder: knitr diff --git a/R/bbw.R b/R/bbw.R index beb2600..6ff1d67 100644 --- a/R/bbw.R +++ b/R/bbw.R @@ -1,64 +1,58 @@ -################################################################################ -# +#' #' Blocked Weighted Bootstrap #' -#' The \code{blocked weighted bootstrap (BBW)} is an estimation technique for +#' The **blocked weighted bootstrap (BBW)** is an estimation technique for #' use with data from two-stage cluster sampled surveys in which either prior -#' weighting (e.g. \code{population proportional sampling} or \code{PPS} as -#' used in \code{Standardized Monitoring and Assessment of Relief and -#' Transitions} or \code{SMART} surveys) or posterior weighting (e.g. as used in -#' \code{Rapid Assessment Method} or \code{RAM} and \code{Simple Spatial -#' Sampling Method} or \code{S3M} surveys). +#' weighting (e.g. **population proportional sampling** or **PPS** as +#' used in **Standardized Monitoring and Assessment of Relief and +#' Transitions** or **SMART** surveys) or posterior weighting (e.g. as used in +#' **Rapid Assessment Method** or **RAM** and **Simple Spatial Sampling Method** +#' or **S3M** surveys). #' #' The bootstrap technique is described in this -#' \href{https://en.wikipedia.org/wiki/Bootstrapping_(statistics)}{article}. -#' The \code{BBW} used in \code{RAM} and \code{S3M} is a modification to the -#' \code{percentile bootstrap} to include \code{blocking} and \code{weighting} to -#' account for a complex sample design. +#' [article](https://en.wikipedia.org/wiki/Bootstrapping_(statistics)). +#' The BBW used in RAM and S3M is a modification to the *percentile bootstrap* +#' to include **blocking** and **weighting** to account for a complex sample +#' design. #' -#' With \code{RAM} and \code{S3M} surveys, the sample is complex in the sense -#' that it is an unweighted cluster sample. Data analysis procedures need to -#' account for the sample design. A \code{blocked weighted bootstrap (BBW)} -#' can be used: -#' \describe{ -#' \item{\code{Blocked}}{The block corresponds to the primary sampling unit -#' (\eqn{PSU = cluster}). \code{PSUs} are resampled with replacement. -#' Observations within the resampled \code{PSUs} are also sampled with -#' replacement.} +#' With RAM and S3M surveys, the sample is complex in the sense that it is an +#' unweighted cluster sample. Data analysis procedures need to account for the +#' sample design. A blocked weighted bootstrap (BBW) can be used: +#' +#' * **Blocked** - The block corresponds to the primary sampling unit +#' `PSU = cluster`. PSUs are resampled with replacement. Observations within the +#' resampled PSUs are also sampled with replacement. #' -#' \item{\code{Weighted}}{\code{RAM} and \code{S3M} samples do not use -#' \code{population proportional sampling (PPS)} to weight the sample prior to -#' data collection (e.g. as is done with \code{SMART} surveys). This means that -#' a posterior weighting procedure is required. \code{bbw} uses a -#' \code{"roulette wheel"} algorithm to weight (i.e. by population) the -#' selection probability of \code{PSUs} in bootstrap replicates.} -#' } +#' * **Weighted** - RAM and S3M samples do not use population proportional +#' sampling (PPS) to weight the sample prior to data collection (e.g. as is done +#' with SMART surveys). This means that a posterior weighting procedure is +#' required. `{bbw}` uses a **"roulette wheel"** algorithm to weight (i.e. by +#' population) the selection probability of PSUs in bootstrap replicates. #' -#' In the case of prior weighting by \code{PPS} all clusters are given the -#' same weight. With posterior weighting (as in \code{RAM} or \code{S3M}) -#' the weight is the population of each \code{PSU}. This procedure is very -#' similar to the \href{https://en.wikipedia.org/wiki/Fitness_proportionate_selection}{fitness proportionate selection} +#' In the case of prior weighting by PPS all clusters are given the same weight. +#' With posterior weighting (as in RAM or S3M) the weight is the population of +#' each PSU. This procedure is very similar to the +#' [fitness proportionate selection](https://en.wikipedia.org/wiki/Fitness_proportionate_selection) #' technique used in evolutionary computing. #' -#' A total of \eqn{m} \code{PSUs} are sampled with replacement for each -#' bootstrap replicate (where \eqn{m} is the number of \code{PSUs} in the survey -#' sample). +#' A total of `m` PSUs are sampled with replacement for each bootstrap replicate +#' (where `m` is the number of PSUs in the survey sample). #' #' The required statistic is applied to each replicate. The reported estimate -#' consists of the \code{0.025th (95\% LCL)}, \code{0.5th (point estimate)}, and -#' \code{0.975th (95\% UCL)} quantiles of the distribution of the statistic across +#' consists of the **0.025th (95% LCL)**, **0.5th (point estimate)**, and +#' **0.975th (95% UCL)** quantiles of the distribution of the statistic across #' all survey replicates. #' -#' Early versions of the \code{bbw} did not resample observations within -#' \code{PSUs} following: +#' Early versions of the `{bbw}` package did not resample observations within +#' PSUs following: #' #' \cite{Cameron AC, Gelbach JB, Miller DL, Bootstrap-based improvements for #' inference with clustered errors, Review of Economics and Statistics, #' 2008:90;414–427 \doi{10.1162/rest.90.3.414}} #' -#' and used a large number (e.g. \eqn{3999}) survey replicates. Current versions of -#' the \code{bbw} resample observations within \code{PSUs} and use a smaller -#' number of survey replicates (e.g. \eqn{n = 400}). This is a more computationally +#' and used a large number (e.g. 3999) survey replicates. Current versions of +#' the `{bbw}` package resample observations within PSUs and use a smaller +#' number of survey replicates (e.g. `n = 400`). This is a more computationally #' efficient approach #' #' @docType package @@ -69,8 +63,6 @@ #' @importFrom car bcPower #' @importFrom withr with_options #' -# -################################################################################ "_PACKAGE" ## quiets concerns of R CMD check re: the psus and THRESHOLD that appear in bbw diff --git a/R/bootBW.r b/R/bootBW.r index 7c653f7..8da4ff3 100644 --- a/R/bootBW.r +++ b/R/bootBW.r @@ -1,4 +1,3 @@ -################################################################################ #' #' Blocked Weighted Bootstrap #' @@ -17,7 +16,7 @@ #' @param outputColumns Names of columns in output data frame #' @param replicates Number of bootstrap replicates #' -#' @return A data frame with: +#' @return A [data.frame()] with: #' * ncol = length(outputColumns) #' * nrow = replicates #' * names = outputColumns @@ -47,8 +46,6 @@ #' #' @export #' -# -################################################################################ bootBW <- function(x, w, statistic, params, outputColumns, replicates = 400) { ## Scale weights and accumulate weights @@ -71,7 +68,7 @@ bootBW <- function(x, w, statistic, params, outputColumns, replicates = 400) { ## And now ... resample! for(i in seq_len(replicates)) { - ## Create a dataframe to hold a survey replicate + ## Create a data.frame to hold a survey replicate xBW <- emptyDF ## Blocking Bootstrap from 'x' (blocking on x$psu = cluster identifier) for(j in seq_len(nClusters)) { diff --git a/R/bootClassic.R b/R/bootClassic.R index ec71a3a..ccb54f0 100644 --- a/R/bootClassic.R +++ b/R/bootClassic.R @@ -1,5 +1,4 @@ -################################################################################ -# +#' #' Simple proportion statistics function for bootstrap estimation #' #' @param x A data frame with **primary sampling unit (PSU)** in column named @@ -14,13 +13,10 @@ #' @examples #' # Example call to bootClassic function #' -#' meanResults <- bootClassic(x = indicatorsHH, -#' params = "anc1") +#' meanResults <- bootClassic(x = indicatorsHH, params = "anc1") #' #' @export #' -# -################################################################################ bootClassic <- function(x, params) { result <- vector(mode = "numeric", length = length(params)) diff --git a/R/bootProbit.R b/R/bootProbit.R index 2bd5d4e..e5b17d0 100644 --- a/R/bootProbit.R +++ b/R/bootProbit.R @@ -30,7 +30,7 @@ bootPROBIT <- function(x, params, threshold = THRESHOLD) { ## Get data d <- x[[params[1]]] - ## Shift data to the left to avoid "comutation instability" when : + ## Shift data to the left to avoid "commutation instability" when : ## max(x) / min(x) ## is small (i.e. close to unity). shift <- min(min(d, na.rm = TRUE), threshold) - 1 diff --git a/R/recode.R b/R/recode.R index 629ff26..6944554 100644 --- a/R/recode.R +++ b/R/recode.R @@ -1,5 +1,4 @@ -############################################################################### -# +#' #' Recode #' #' Utility function that recodes variables based on user recode specifications. @@ -59,7 +58,7 @@ #' the sort order of the level names. #' @return Recoded variable #' @examples -#' # Recode values from 1 to 9 to varios specifications +#' # Recode values from 1 to 9 to various specifications #' var <- sample(x = 1:9, size = 100, replace = TRUE) #' #' # Recode single values @@ -76,8 +75,7 @@ #' #' @export #' -# -################################################################################ + recode <- function(var, recodes, afr, anr = TRUE, levels) { squeezeBlanks <- function(text) { gsub(" *", "", text) diff --git a/README.Rmd b/README.Rmd index 30afb10..67e2924 100644 --- a/README.Rmd +++ b/README.Rmd @@ -21,10 +21,10 @@ knitr::opts_chunk$set( [![CRAN](https://img.shields.io/cran/l/bbw.svg)](https://CRAN.R-project.org/package=bbw) [![CRAN](http://cranlogs.r-pkg.org/badges/bbw)](https://CRAN.R-project.org/package=bbw) [![CRAN](http://cranlogs.r-pkg.org/badges/grand-total/bbw)](https://CRAN.R-project.org/package=bbw) -![R-CMD-check](https://github.com/rapidsurveys/bbw/workflows/R-CMD-check/badge.svg) -![test-coverage](https://github.com/rapidsurveys/bbw/workflows/test-coverage/badge.svg) -[![Codecov test coverage](https://codecov.io/gh/rapidsurveys/bbw/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rapidsurveys/bbw?branch=master) +[![R-CMD-check](https://github.com/rapidsurveys/bbw/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rapidsurveys/bbw/actions/workflows/R-CMD-check.yaml) +[![test-coverage](https://github.com/rapidsurveys/bbw/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/rapidsurveys/bbw/actions/workflows/test-coverage.yaml) [![CodeFactor](https://www.codefactor.io/repository/github/rapidsurveys/bbw/badge)](https://www.codefactor.io/repository/github/rapidsurveys/bbw) +[![DOI](https://zenodo.org/badge/117305174.svg)](https://doi.org/10.5281/zenodo.6594797) ## Overview @@ -32,41 +32,61 @@ The **blocked weighted bootstrap** is an estimation technique for use with data ## Installation -You can install `bbw` from CRAN with: +You can install `{bbw}` from CRAN with: ```{r install_cran, eval = FALSE} install.packages("bbw") ``` -You can install the current development version of `bbw` from GitHub via the `remotes` package with: +You can install the current development version of `{bbw}` from the [RapidSurveys R Universe](https://rapidsurveys.r-universe.dev) with: + +```{r install_universe, eval = FALSE} +install.packages("bbw", repos = "https://rapidsurveys.r-universe.dev") +``` + +or through GitHub via the `{pak}` package with: ```{r install_github, eval = FALSE} -if(!require(remotes)) install.packages("remotes") -remotes::install_github("rapidsurveys/bbw") +if(!require(pak)) install.packages("pak") +pak::pak("rapidsurveys/bbw") ``` ## Usage -`bbw` as used in **RAM** and **S3M** is a modification to the *percentile bootstrap* to include *blocking* and *weighting* to account for a *complex sample design*. +`{bbw}` as used in RAM and S3M is a modification to the *percentile bootstrap* to include *blocking* and *weighting* to account for a *complex sample design*. - -With **RAM** and **S3M** surveys, the sample is complex in the sense that it is an unweighted cluster sample. Data analysis procedures need to account for the sample design. A **blocked weighted bootstrap** can be used: +With RAM and S3M surveys, the sample is complex in the sense that it is an unweighted cluster sample. Data analysis procedures need to account for the sample design. A blocked weighted bootstrap can be used:
-**Blocked**: The block corresponds to the primary sampling unit (*PSU = cluster*). *PSU*s are resampled with replacement. Observations within the resampled *PSU*s are also sampled with replacement. +* **Blocked**: The block corresponds to the primary sampling unit (*PSU = cluster*). PSUs are resampled with replacement. Observations within the resampled PSUs are also sampled with replacement. -**Weighted**: **RAM** and **S3M** samples do not use *population proportional sampling (PPS)* to weight the sample prior to data collection (e.g. as is done with **SMART** surveys). This means that a posterior weighting procedure is required. `bbw` uses a *"roulette wheel"* algorithm (see [illustration below](#FIG1)) to weight (i.e. by population) the selection probability of *PSU*s in bootstrap replicates. +* **Weighted**: RAM and S3M samples do not use population proportional sampling (PPS) to weight the sample prior to data collection (e.g. as is done with SMART surveys). This means that a posterior weighting procedure is required. `{bbw}` uses a *"roulette wheel"* algorithm (see [illustration below](#FIG1)) to weight (i.e. by population) the selection probability of PSUs in bootstrap replicates. +

-```{r, echo = FALSE, eval = TRUE, out.width = "50%", fig.align = "center"} +```{r, echo = FALSE, eval = TRUE, out.width = "50%", fig.alt = "Roulette wheel algorithm", fig.align = "center"} knitr::include_graphics("man/figures/rouletteWheel.png") ```

-In the case of prior weighting by *PPS* all clusters are given the same weight. With posterior weighting (as in **RAM** or **S3M**) the weight is the population of each *PSU*. This procedure is very similar to the *fitness proportional selection* technique used in *evolutionary computing*. +In the case of prior weighting by PPS all clusters are given the same weight. With posterior weighting (as in RAM or S3M) the weight is the population of each PSU. This procedure is very similar to the *fitness proportional selection* technique used in *evolutionary computing*. -A total of *m* *PSU*s are sampled with replacement for each bootstrap replicate (where *m* is the number of *PSU*s in the survey sample). +A total of `m` PSUs are sampled with replacement for each bootstrap replicate (where `m` is the number of PSUs in the survey sample). The required statistic is applied to each replicate. The reported estimate consists of the 0.025th (*95% LCL*), 0.5th (*point estimate*), and 0.975th (*95% UCL*) quantiles of the distribution of the statistic across all survey replicates. -The main reason to use `bbw` is that the bootstrap allows a wider range statistics to be calculated than model-based techniques without resort to grand assumptions about the sampling distribution of the required statistic. A good example for this is the confidence interval on the difference between two medians which might be used for many socio-economic variables. The `bbw` also allows for a wider range of hypothesis tests to be used with complex sample survey data. +The main reason to use `{bbw}` is that the bootstrap allows a wider range statistics to be calculated than model-based techniques without resort to grand assumptions about the sampling distribution of the required statistic. A good example for this is the confidence interval on the difference between two medians which might be used for many socio-economic variables. The `{bbw}` also allows for a wider range of hypothesis tests to be used with complex sample survey data. + +## Citation + +If you use the {bbw} package in your work, please cite using the suggested citation provided by a call to the `citation()` function as follows: + +```{r cite} +citation("bbw") +``` + +## Community guidelines + +Feedback, bug reports, and feature requests are welcome; file issues or seek support [here](https://github.com/rapidsurveys/bbw/issues). If you would like to contribute to the package, please see our [contributing guidelines](https://rapidsurveys.io/bbw/CONTRIBUTING.html). + +This project is released with a [Contributor Code of Conduct](https://rapidsurveys.io/bbw/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. diff --git a/README.md b/README.md index 7990f09..bfd3105 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,10 @@ stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https:// [![CRAN](https://img.shields.io/cran/l/bbw.svg)](https://CRAN.R-project.org/package=bbw) [![CRAN](http://cranlogs.r-pkg.org/badges/bbw)](https://CRAN.R-project.org/package=bbw) [![CRAN](http://cranlogs.r-pkg.org/badges/grand-total/bbw)](https://CRAN.R-project.org/package=bbw) -![R-CMD-check](https://github.com/rapidsurveys/bbw/workflows/R-CMD-check/badge.svg) -![test-coverage](https://github.com/rapidsurveys/bbw/workflows/test-coverage/badge.svg) -[![Codecov test -coverage](https://codecov.io/gh/rapidsurveys/bbw/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rapidsurveys/bbw?branch=master) +[![R-CMD-check](https://github.com/rapidsurveys/bbw/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rapidsurveys/bbw/actions/workflows/R-CMD-check.yaml) +[![test-coverage](https://github.com/rapidsurveys/bbw/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/rapidsurveys/bbw/actions/workflows/test-coverage.yaml) [![CodeFactor](https://www.codefactor.io/repository/github/rapidsurveys/bbw/badge)](https://www.codefactor.io/repository/github/rapidsurveys/bbw) +[![DOI](https://zenodo.org/badge/117305174.svg)](https://doi.org/10.5281/zenodo.6594797) ## Overview @@ -33,66 +32,113 @@ Assessment Method** or **RAM** and **Simple Spatial Sampling Method** or ## Installation -You can install `bbw` from CRAN with: +You can install `{bbw}` from CRAN with: ``` r install.packages("bbw") ``` -You can install the current development version of `bbw` from GitHub via -the `remotes` package with: +You can install the current development version of `{bbw}` from the +[RapidSurveys R Universe](https://rapidsurveys.r-universe.dev) with: ``` r -if(!require(remotes)) install.packages("remotes") -remotes::install_github("rapidsurveys/bbw") +install.packages("bbw", repos = "https://rapidsurveys.r-universe.dev") +``` + +or through GitHub via the `{pak}` package with: + +``` r +if(!require(pak)) install.packages("pak") +pak::pak("rapidsurveys/bbw") ``` ## Usage -`bbw` as used in **RAM** and **S3M** is a modification to the -*percentile bootstrap* to include *blocking* and *weighting* to account -for a *complex sample design*. +`{bbw}` as used in RAM and S3M is a modification to the *percentile +bootstrap* to include *blocking* and *weighting* to account for a +*complex sample design*. -With **RAM** and **S3M** surveys, the sample is complex in the sense -that it is an unweighted cluster sample. Data analysis procedures need -to account for the sample design. A **blocked weighted bootstrap** can -be used: +With RAM and S3M surveys, the sample is complex in the sense that it is +an unweighted cluster sample. Data analysis procedures need to account +for the sample design. A blocked weighted bootstrap can be used:
-**Blocked**: The block corresponds to the primary sampling unit (*PSU = -cluster*). *PSU*s are resampled with replacement. Observations within -the resampled *PSU*s are also sampled with replacement. + - **Blocked**: The block corresponds to the primary sampling unit + (*PSU = cluster*). PSUs are resampled with replacement. Observations + within the resampled PSUs are also sampled with replacement. -**Weighted**: **RAM** and **S3M** samples do not use *population -proportional sampling (PPS)* to weight the sample prior to data -collection (e.g. as is done with **SMART** surveys). This means that a -posterior weighting procedure is required. `bbw` uses a *“roulette -wheel”* algorithm (see [illustration below](#FIG1)) to weight (i.e. by -population) the selection probability of *PSU*s in bootstrap replicates. + - **Weighted**: RAM and S3M samples do not use population proportional + sampling (PPS) to weight the sample prior to data collection + (e.g. as is done with SMART surveys). This means that a posterior + weighting procedure is required. `{bbw}` uses a *“roulette wheel”* + algorithm (see [illustration below](#FIG1)) to weight (i.e. by + population) the selection probability of PSUs in bootstrap + replicates. + +

- + +Roulette wheel algorithm +

-In the case of prior weighting by *PPS* all clusters are given the same -weight. With posterior weighting (as in **RAM** or **S3M**) the weight -is the population of each *PSU*. This procedure is very similar to the -*fitness proportional selection* technique used in *evolutionary -computing*. +In the case of prior weighting by PPS all clusters are given the same +weight. With posterior weighting (as in RAM or S3M) the weight is the +population of each PSU. This procedure is very similar to the *fitness +proportional selection* technique used in *evolutionary computing*. -A total of *m* *PSU*s are sampled with replacement for each bootstrap -replicate (where *m* is the number of *PSU*s in the survey sample). +A total of `m` PSUs are sampled with replacement for each bootstrap +replicate (where `m` is the number of PSUs in the survey sample). The required statistic is applied to each replicate. The reported estimate consists of the 0.025th (*95% LCL*), 0.5th (*point estimate*), and 0.975th (*95% UCL*) quantiles of the distribution of the statistic across all survey replicates. -The main reason to use `bbw` is that the bootstrap allows a wider range -statistics to be calculated than model-based techniques without resort -to grand assumptions about the sampling distribution of the required -statistic. A good example for this is the confidence interval on the -difference between two medians which might be used for many -socio-economic variables. The `bbw` also allows for a wider range of +The main reason to use `{bbw}` is that the bootstrap allows a wider +range statistics to be calculated than model-based techniques without +resort to grand assumptions about the sampling distribution of the +required statistic. A good example for this is the confidence interval +on the difference between two medians which might be used for many +socio-economic variables. The `{bbw}` also allows for a wider range of hypothesis tests to be used with complex sample survey data. + +## Citation + +If you use the {bbw} package in your work, please cite using the +suggested citation provided by a call to the `citation()` function as +follows: + +``` r +citation("bbw") +#> Warning in citation("bbw"): could not determine year for 'bbw' +#> from package DESCRIPTION file +#> To cite package 'bbw' in publications use: +#> +#> Myatt M, Guevarra E (????). _bbw: Blocked Weighted +#> Bootstrap_. R package version 0.2.1.9000, +#> https://rapidsurveys.io/bbw/, +#> . +#> +#> A BibTeX entry for LaTeX users is +#> +#> @Manual{, +#> title = {bbw: Blocked Weighted Bootstrap}, +#> author = {Mark Myatt and Ernest Guevarra}, +#> note = {R package version 0.2.1.9000, https://rapidsurveys.io/bbw/}, +#> url = {https://github.com/rapidsurveys/bbw}, +#> } +``` + +## Community guidelines + +Feedback, bug reports, and feature requests are welcome; file issues or +seek support [here](https://github.com/rapidsurveys/bbw/issues). If you +would like to contribute to the package, please see our [contributing +guidelines](https://rapidsurveys.io/bbw/CONTRIBUTING.html). + +This project is released with a [Contributor Code of +Conduct](https://rapidsurveys.io/bbw/CODE_OF_CONDUCT.html). By +contributing to this project, you agree to abide by its terms. diff --git a/docs/404.html b/docs/404.html index e0bdcae..0b4497c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -13,64 +13,50 @@ - - - - + + + + - Skip to contents - -