msbinom: Calculates the mean and the standard deviation of a discreet...

mbinom and sbinomR Documentation

Calculates the mean and the standard deviation of a discreet random variable

Description

The function expects a tabel (a data frame or a matrix) with just two columns: the first containing the values of a random variable, and the associated probabilities in the second column.

Usage

mbinom(x)
sbinom(x)

Arguments

x

The data table.

Details

If the sum of the probabilities on the second columns is not equal to 1, the function interprets them as absolute values and recalculates the relative frequencies.

Author(s)

Adrian Dusa

Examples


data <- matrix(c(0:4, 0.015, 0.235, 0.425, 0.245, 0.080), ncol = 2)
mbinom(data)
sbinom(data)

data <- data.frame(X = 0:4, P_X = c(12, 188, 340, 196, 64))
mbinom(data)
sbinom(data) 


dusadrian/statistics documentation built on Jan. 26, 2023, 11:55 p.m.