est_multinom: Estimate multinomial cell probabilities in a 2x2 table

Description Usage Arguments Details References Examples

View source: R/est_multinom.R

Description

Simulatenously estimates of multinomial cell probabilities.

Usage

1
est_multinom(x, n = NULL, prior = NULL, groups = c("test", "control"))

Arguments

x

A numeric vector of success counts OR a 2x2 table.

n

A numeric vector of totals.

prior

A matrix of hyper-parameters.

Details

The model assumes no margins are fixed. Two random binary outcomes are measured on N individuals, resulting in four possible combined outcomes with probabilities p_{11}, p_{12}, p_{21}, p_{22}.

References

Fienberg, S.E. and Holland, P.W. (1973) Simultaneous estimation of multinomial cell probabilities. Journal of the American Statistical Association, 68, 683-691. doi:10.1080/01621459.1973.10481405

Examples

1
2
3
4
5
6
7
8
9
fake_data <- matrix(c(200, 150, 250, 300), nrow = 2, byrow = TRUE)
colnames(fake_data) <- c('Safe' ,'Dangerous')
rownames(fake_data) <- c('Animals', 'Plants')
est_multinom(fake_data)

est_multinom(x = c(200, 250), n = c(350, 550))

hyperparams <- matrix(c(0.25, 0.2, 0.15, 0.4), nrow = 2, byrow = TRUE)
est_multinom(fake_data, prior = hyperparams)

bearloga/BCDA documentation built on Feb. 8, 2021, 3:43 p.m.