{"id":24906209,"url":"https://github.com/mightymetrika/bootwar","last_synced_at":"2025-03-27T22:22:24.607Z","repository":{"id":187718618,"uuid":"677011146","full_name":"mightymetrika/bootwar","owner":"mightymetrika","description":"Nonparametric Bootstrap Test with Pooled Resampling Card Game","archived":false,"fork":false,"pushed_at":"2023-10-09T13:56:12.000Z","size":4767,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-24T15:50:24.528Z","etag":null,"topics":["bootstrap","data-science","r","resampling","statistics"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mightymetrika.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-10T14:27:01.000Z","updated_at":"2023-08-20T14:56:03.000Z","dependencies_parsed_at":"2025-02-02T00:39:10.802Z","dependency_job_id":"c44c2b33-4418-4123-9aec-438cce329799","html_url":"https://github.com/mightymetrika/bootwar","commit_stats":null,"previous_names":["mightymetrika/bootwar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mightymetrika%2Fbootwar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mightymetrika%2Fbootwar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mightymetrika%2Fbootwar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mightymetrika%2Fbootwar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mightymetrika","download_url":"https://codeload.github.com/mightymetrika/bootwar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245932332,"owners_count":20696038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","data-science","r","resampling","statistics"],"created_at":"2025-02-02T00:39:08.803Z","updated_at":"2025-03-27T22:22:24.568Z","avatar_url":"https://github.com/mightymetrika.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# bootwar\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n'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).\n\nInspired 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.\n\n## Installation\n\nYou can install the released version of 'bootwar' from [CRAN](https://CRAN.R-project.org):\n\n```{r eval=FALSE}\ninstall.packages(\"bootwar\")\n```\n\n\nInstall the development version of bootwar from GitHub using [devtools](https://devtools.r-lib.org/):\n\n```{r, eval=FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"mightymetrika/bootwar\")\n```\n\n## Example\n\nThis example demonstrates how to play a five-round game of bootwar:\n\n### Initialization:\n\n```{r}\n# Load bootwar\nlibrary(bootwar)\n\n# Set up vectors for computer and player's cards and values\ncomp_cv \u003c- vector(mode = \"character\")\ncomp_vv \u003c- vector(mode = \"numeric\")\nplyr_cv \u003c- vector(mode = \"character\")\nplyr_vv \u003c- vector(mode = \"numeric\")\n\n# Shuffle a 52 card standard deck from the 'mmcards' package\nsdeck \u003c- mmcards::shuffle_deck(seed = 150)\nhead(sdeck)\n```\n\n\n### Play the First Round:\n\n```{r}\nrres \u003c- play_round(cdeck = sdeck,\n                   plyr_cv = plyr_cv, plyr_vv = plyr_vv,\n                   comp_cv = comp_cv, comp_vv = comp_vv)\n```\n\n\n### Continue the Game for Four More Rounds:\n\n```{r}\nfor (i in 1:4) {\n  rres \u003c- play_round(cdeck = rres$updated_deck,\n                     plyr_cv = rres$plyr_cv, plyr_vv = rres$plyr_vv,\n                     comp_cv = rres$comp_cv, comp_vv = rres$comp_vv)\n}\n\n# Ensure 10 cards have been dealt\nnrow(rres$updated_deck)\n```\n\n\n### Analyze the Game:\n\nUse 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).\n\n```{r}\ngres \u003c- analyze_game(plyr_vv = rres$plyr_vv, comp_vv = rres$comp_vv,\n                     mode = \"pt\", nboot = 1000, seed = 150, conf.level = 0.05)\n\n# Display game results\ngres$winner\ngres$bootstrap_results$effect.size\ngres$bootstrap_results$ci.effect.size\ngres$bootstrap_results$p.value\n```\n\n\nFor a more streamlined gameplay experience, the bootwar() function launches an interactive Shiny web application.\n\nUsers 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.\n\n## References\n\nDwivedi 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmightymetrika%2Fbootwar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmightymetrika%2Fbootwar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmightymetrika%2Fbootwar/lists"}