Description Usage Arguments Details Value See Also Examples
View source: R/binomial_pmf_movie.R
A movie to illustrate how the probability mass function (p.m.f.) of a binomial (n, p) random variable depends on n and p.
1 2 | binomial_pmf_movie(starting_n = 1, starting_p = 1/2, delta_n = 1,
delta_p = 0.05, observed_value = NA)
|
starting_n |
A numeric scalar. The value of n for the first graph. |
starting_p |
A numeric scalar. The value of p for the first graph. |
delta_n |
A numeric scalar. The amount by which n is increased (or decreased) after one click of the + (or -) button in the parameter window. |
delta_p |
A numeric scalar. The amount by which p is increased (or decreased) after one click of the + (or -) button in the parameter window. |
observed_value |
A non-negative integer. If |
The probability mass function of a binomial random variable with parameters n (the number of Bernoulli trials performed) and p (the probabilities of success on a each trial) is plotted. The values of n and p can be changed by clicking on the relevant buttons.
Nothing is returned, only the animation is produced.
movies
: general information about the movies.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Load package rpanel
# [Use install.packages("rpanel") if necessary]
library(rpanel)
## Not run:
binomial_pmf_movie()
# Increase n and see what happens
binomial_pmf_movie(delta_n = 10)
# Sample size of the Aussie births data (26 boys, 18 girls)
binomial_pmf_movie(starting_n = 44, starting_p = 0.1, delta_p = 0.1,
observed_value = 26)
# Start at p = 0.591 (approximately 26/44)
binomial_pmf_movie(starting_n = 44, starting_p = 0.591, delta_p = 0.01,
observed_value = 26)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.