binomialmoments: Compute Moments of Binomial Probability Mass Functions.

View source: R/betafunctions.R

binomialmomentsR Documentation

Compute Moments of Binomial Probability Mass Functions.

Description

Computes Raw, Central, or Standardized moment properties of defined Binomial probability mass functions.

Usage

binomialmoments(n, p, types = c("raw", "central", "standardized"), orders = 4)

Arguments

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.

Value

A list of moment types, each a list of moment orders.

Examples

# 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)

betafunctions documentation built on May 29, 2024, 1:13 a.m.