addProbs {DanielBiostatistics10th}R Documentation

Conditional and/or Marginal Probabilities

Description

Add conditional and/or marginal probabilities to a two-way contingency table.

Usage

addProbs(A, margin = seq_len(nd))

Arguments

A

matrix of typeof integer, two-dimensional contingency table. See addmargins

margin

integer scalar or vector, see addmargins

Details

Function addProbs provides the joint, marginal (using margin = 1:2) and conditional (using margin = 1L or margin = 2L) probabilities of a two-dimensional contingency table.

Value

Function addProbs returns an 'addProbs' object, which inherits from table and noquote.

Note

margin.table (which is to be renamed as marginSums) is much slower than colSums.

See Also

rowSums colSums proportions

Examples

(y1 = addProbs(table(warpbreaks$tension)))

storage.mode(WorldPhones) = 'integer'
(y2 = addProbs(WorldPhones))


[Package DanielBiostatistics10th version 0.2.2 Index]