meanvarsd: Random Variable Statistic Calculator.

Description Usage Arguments Value Examples

View source: R/meanvarsd.R

Description

Given a discrete random variable distribution, return the mean, variance and standard deviation.

Usage

1

Arguments

d

dataframe with two columns, x and p. x represents the value of the RV. p represents the probability corresponding to that value.

Value

vector of length 3 (mean, var, sd)

Examples

1
2
3
4
x <- c(1,5,6)
p <- c(.2,.2,.6)
v <- data.frame (x,p)
meanvarsd(v)

merc534/STAT3701-HW3 documentation built on May 25, 2019, 10:30 p.m.