analyze_game: Analyze Game Results and Determine Winner

View source: R/analysis_funcs.R

analyze_gameR Documentation

Analyze Game Results and Determine Winner

Description

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.

Usage

analyze_game(plyr_vv, comp_vv, mode = "t", conf.level = 0.95, ...)

Arguments

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 npboottprm::nonparboot, stats::t.test. The confidence level is also used to set the alpha level to alpha = 1 - conf.level

...

Additional arguments passed to the npboottprm::nonparboot function.

Value

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").

Examples

# 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)


bootwar documentation built on Oct. 1, 2023, 5:07 p.m.