Learn R Programming

cta (version 1.3.0)

M.fct: Marginalizing Matrix Based on Strata Information

Description

Creates the marginalizing matrix \(M\) using strata information found in input variable strata. That is, \(Mp\) gives the marginal probabilities corresponding to the levels of factor strata.

Usage

M.fct(strata, ncells = length(strata))

Arguments

strata

The vector that gives the stratum membership identifier.

ncells

Number of contingency table cells. Default: ncells = length(strata).

Value

M.fct returns the marginalizing matrix M.

References

Lang, J. B. (2004) Multinomial-Poisson homogeneous models for contingency tables, Annals of Statistics, 32, 340--383.

Examples

Run this code
# NOT RUN {
M.fct(rep(1, 9))
M.fct(seq(1, 9))
M.fct(c(1, 1, 2, 3, 3))
# }

Run the code above in your browser using DataLab