View source: R/betafunctions.R
binomialmoments | R Documentation |
Computes Raw, Central, or Standardized moment properties of defined Binomial probability mass functions.
binomialmoments(n, p, types = c("raw", "central", "standardized"), orders = 4)
n |
Number of Binomial trials |
p |
Probability of success per trial. |
types |
A character vector determining which moment-types are to be calculated. Permissible values are "raw", "central", and "standardized". |
orders |
The number of moment-orders to be calculated for each of the moment-types. |
A list of moment types, each a list of moment orders.
# Assume some variable follows a Binomial distribution with number of trials
# equal to 100 and a probability of success on each trial of 0.75. To compute
# the first four raw, central, and standardized moments of this distribution
# using binomialmoments():
binomialmoments(n = 100, p = 0.75, types = c("raw", "central",
"standardized"), orders = 4)
# To only compute the (e.g.) standardized moments:
binomialmoments(n = 100, p = 0.75, types = "standardized")
# To compute moments beyond the fourth order (e.g., the sixth):
binomialmoments(n = 100, p = 0.75, orders = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.