Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/papagorgio23/bettor

R Package for Sports betting
https://github.com/papagorgio23/bettor

betting sports sports-analytics sports-betting sports-betting-formulas sports-stats sportsbook

Last synced: 23 days ago
JSON representation

R Package for Sports betting

Awesome Lists containing this project

README

        

---
title: "*bettoR*"
output: github_document
---

#

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(bettoR)
library(knitr)
```

![GitHub release (latest by date)](https://img.shields.io/github/v/release/papagorgio23/bettoR)
[![R-CMD-check](https://github.com/papagorgio23/bettoR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/papagorgio23/bettoR/actions/workflows/R-CMD-check.yaml)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Twitter Follow](https://img.shields.io/twitter/follow/theFirmAISports?style=social)](https://twitter.com/theFirmAISports)

## Tools for Sports Betting

This package contains tools and functions to help sports bettors make more money!

## Installation

You can install bettoR from [GitHub](https://github.com/papagorgio23/bettoR) with:

```{r installs, eval=FALSE}
# install.packages("devtools")
devtools::install_github("papagorgio23/bettoR")
```

## Examples

#### Implied Probability

Implied probabilities, or break-even win percentage, can easily be found with this function. Here is an example with given odds of -350 (US Odds), 180 (US Odds), 2.5 (Decimal Odds), 4.9 (Decimal Odds), 6-1 (Fractional Odds), 2/7 (Fractional Odds).

```{r}
implied_prob(-350, type = "us")
```

```{r}
implied_prob(180, type = "us")
```

```{r}
implied_prob(2.5, type = "dec")
```

```{r}
implied_prob(4.9, type = "dec")
```

```{r}
implied_prob(6/1, type = "frac")
```

```{r}
implied_prob(2/7, type = "frac")
```

#### Odds from Probabilities

Let's say you believe a bet has a 75% chance to cover, what would the price be? Using the implied odds function can give you the price based on your probability.

```{r}
implied_odds(0.75, type = "us")
```

```{r}
implied_odds(0.75, type = "frac")
```

```{r}
implied_odds(0.75, type = "dec")
```

```{r}
implied_odds(0.75, type = "all")
```

#### Converting Odds

Let's say you want to convert the American Odds you see on the screen (-175) to another type.

```{r}
convert_odds(-175)
```

#### Calculate Sportsbook's hold

Betting into a market is difficult enough as is but some sportsbooks skew the odds even more in their favor. (-110, -110) is the industry standard. The hold, or vig/juice, for this bet can be found like this:

```{r}
hold_calc(-110, -110)
```

Some sportsbooks in newly legalized states are taking advantage of bettors with lines (-125, -125)

```{r}
hold_calc(-125, -125)
```

The increase in juice for this is:

```{r}
(hold_calc(-125, -125) - hold_calc(-110, -110)) / hold_calc(-110, -110)
```

120% increase in price.

## Special Thanks

* To the entire [A.I. Sports](https://aisportsfirm.com/home/our-team/) team!