View source: R/analysis_funcs.R
analyze_game | R Documentation |
This function analyzes the results of the game using both nonparametric bootstrap with pooled resampling and classical t-tests. It then determines the winner based on the bootstrap results and effect size.
analyze_game(plyr_vv, comp_vv, mode = "t", conf.level = 0.95, ...)
plyr_vv |
A numeric vector storing the values of the cards dealt to the player. |
comp_vv |
A numeric vector storing the values of the cards dealt to the computer. |
mode |
A character string indicating the type of test. Valid options are "t" for independent t-test and "pt" for paired t-test. Default is "t". |
conf.level |
A confidence level for |
... |
Additional arguments passed to the |
A list containing:
bootstrap_results
: A list containing results from the bootstrap test.
classical_results
: A list containing results from the classical t-test.
winner
: A character string indicating the winner ("Player Wins", "Computer Wins", or "Draw").
# Analyze a sample game
plyr_values <- c(4, 3, 2, 1)
comp_values <- c(1, 2, 3, 4)
game_results <- analyze_game(plyr_values, comp_values, nboot = 1000,
mode = "t", seed = 150)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.