bootwar
Nonparametric Bootstrap Test with Pooled Resampling Card Game
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.6%) to scientific vocabulary
Keywords
bootstrap
data-science
r
resampling
statistics
Last synced: 6 months ago
·
JSON representation
Repository
Nonparametric Bootstrap Test with Pooled Resampling Card Game
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
bootstrap
data-science
r
resampling
statistics
Created over 2 years ago
· Last pushed over 2 years ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# bootwar
'bootwar' aims to help users build their intuition about nonparametric bootstrap tests with pooled resampling, especially for independent and paired t-tests (Dwivedi, Mallawaarachchi, and Alvarado, 2017).
Inspired by the card game War, which has straightforward rules but can be time-consuming, 'bootwar' is a variant with smaller sample sizes. Here, after playing a user-defined number of rounds, a winner is determined through nonparametric bootstrap tests with pooled resampling as implemented in the [npboottprm](https://CRAN.R-project.org/package=npboottprm) R package.
## Installation
You can install the released version of 'bootwar' from [CRAN](https://CRAN.R-project.org):
```{r eval=FALSE}
install.packages("bootwar")
```
Install the development version of bootwar from GitHub using [devtools](https://devtools.r-lib.org/):
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("mightymetrika/bootwar")
```
## Example
This example demonstrates how to play a five-round game of bootwar:
### Initialization:
```{r}
# Load bootwar
library(bootwar)
# Set up vectors for computer and player's cards and values
comp_cv <- vector(mode = "character")
comp_vv <- vector(mode = "numeric")
plyr_cv <- vector(mode = "character")
plyr_vv <- vector(mode = "numeric")
# Shuffle a 52 card standard deck from the 'mmcards' package
sdeck <- mmcards::shuffle_deck(seed = 150)
head(sdeck)
```
### Play the First Round:
```{r}
rres <- play_round(cdeck = sdeck,
plyr_cv = plyr_cv, plyr_vv = plyr_vv,
comp_cv = comp_cv, comp_vv = comp_vv)
```
### Continue the Game for Four More Rounds:
```{r}
for (i in 1:4) {
rres <- play_round(cdeck = rres$updated_deck,
plyr_cv = rres$plyr_cv, plyr_vv = rres$plyr_vv,
comp_cv = rres$comp_cv, comp_vv = rres$comp_vv)
}
# Ensure 10 cards have been dealt
nrow(rres$updated_deck)
```
### Analyze the Game:
Use analyze_game() to evaluate the results. In this example, we'll apply the paired t-test, but users can opt for the independent t-test by setting mode to 't'. Modify the conf.level parameter to change the confidence interval (think of this as a level which controls the amount of draws).
```{r}
gres <- analyze_game(plyr_vv = rres$plyr_vv, comp_vv = rres$comp_vv,
mode = "pt", nboot = 1000, seed = 150, conf.level = 0.05)
# Display game results
gres$winner
gres$bootstrap_results$effect.size
gres$bootstrap_results$ci.effect.size
gres$bootstrap_results$p.value
```
For a more streamlined gameplay experience, the bootwar() function launches an interactive Shiny web application.
Users can also customize the game using an anonymous function for deck definition, as showcased in the anonymous-bootwar vignette. Users can also customize the game by using an anonymous function to define a different deck for each player, as showcased in the interleaved-bootwar vignette.
## References
Dwivedi AK, Mallawaarachchi I, Alvarado LA (2017). "Analysis of small sample size studies using nonparametric bootstrap test with pooled resampling method." Statistics in Medicine, 36 (14), 2187-2205.
Owner
- Login: mightymetrika
- Kind: user
- Website: mightymetrika.com
- Twitter: mightymetrika
- Repositories: 23
- Profile: https://github.com/mightymetrika
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 2
- Total pull requests: 19
- Average time to close issues: 29 days
- Average time to close pull requests: 1 minute
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 19
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mightymetrika (2)
Pull Request Authors
- mncube (18)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 262 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
cran.r-project.org: bootwar
Nonparametric Bootstrap Test with Pooled Resampling Card Game
- Homepage: https://github.com/mightymetrika/bootwar
- Documentation: http://cran.r-project.org/web/packages/bootwar/bootwar.pdf
- License: MIT + file LICENSE
-
Latest release: 0.2.1
published over 2 years ago
Rankings
Forks count: 21.5%
Dependent packages count: 28.5%
Stargazers count: 35.0%
Dependent repos count: 37.0%
Average: 42.0%
Downloads: 88.1%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 2.10 depends
- npboottprm * imports
- testthat >= 3.0.0 suggests