disc.jexp: Expected Values of Two Discrete Random Variables

Description Usage Arguments Value Examples

View source: R/ch5-fn.R

Description

Joint Probabilities and Expected Values of Two Discrete Random Variables

Usage

1
2
disc.jexp(tabXY, Xn = "X", Yn = "Y", prt = "exp", pprt = FALSE,
  dig = 4)

Arguments

tabXY

Joint frequency (or probability) table

Xn

Name of X, Default: 'X'

Yn

Name of Y, Default: 'Y'

prt

Option for detailed output in c("", "exp", "cov", "cor"), Default: 'exp'

pprt

Plot the joint & marginal PDF? Default: FALSE

dig

Number of digits below the decimal point, Default: 4

Value

list(Ex=E(X), Dx=D(X), Ey=E(Y), Dy=D(Y), Vxy=Cov(X,Y), Cxy=Corr(X,Y))

Examples

1
2
3
4
5
S = rolldie2(2)
X = apply(S, 1, max)
Y = apply(S, 1, min)
tXY = table(X, Y)
disc.jexp(tXY, prt="cor", pprt=TRUE)

tjssu/Rstat documentation built on Aug. 8, 2020, 12:38 p.m.