knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

prediction.game

The goal of prediction.game is to provide a function for the interactive testing --- as a demonstration during class --- of competing answers to a statistical question.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("davidkane9/prediction.game")

Example

This is a basic example. The data is a vector of length 10. The contest is to pick a number which is closest to the result of a random sample (of size 1) from that data. One person guesses 3. Another person guesses 7. We run the context 5 times. In the example, each guess "won" twice and there was one tie.

library(prediction.game)

set.seed(10)

play(data = 1:10, n = 5, guess_1 = 3, guess_2 = 7, sample, size = 1)


davidkane9/prediction.game documentation built on Nov. 4, 2019, 9:45 a.m.