knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library("binomial")
The most common discrete probability distribution, most often exemplified by a series of coin flips. This package allows a user to explore important questions like, "What are the odds of flipping a fair coin heads 3 out of 4 tosses?"
Quickly lets answer this question before moving on to more spectacular things.
bin_probability(success = 3, trials = 4, prob = .5)
So as you can see, specifying success
for the amount of successful results, trials
the number of trials, and prob
the porbability of the successful outcome, we can answer any such question.
We can see the answers to a wide variety of these kinds of questions, if we graph them!
dist <- bin_distribution(100, .5) plot.bindis(dist)
As well, we can see the probability of getting more or fewer than a certain amount of successes.
cumu <- bin_cumulative(100, .5) plot.bincum(cumu)
We can see detailed info on these distributions using bin_variable and summary.binvar, where the output of bin_variable is an input to summary.binvar.
vars <- bin_variable(100, .5) summary.binvar(vars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.