Description Usage Arguments Value Note Author(s) References Examples
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
.
1 |
strata |
The vector that gives the stratum membership identifier. |
ncells |
Number of contingency table cells. Default:
|
M.fct
returns the marginalizing matrix M
.
Marginals are ordered according to the levels of factor
strata
.
Examples:
V1 | V2 | y |
b | yes | 15 |
a | no | 12 |
a | yes | 13 |
b | yes | 5 |
b | no | 1 |
M1 <- M.fct(V1)
M1 %*% y
[,1] |
|
a | 25 |
b | 21 |
M2 <- M.fct(V2)
M2 %*% y
[,1] |
|
no | 13 |
yes | 33 |
M12 <- M.fct(paste(V1, V2))
M12 %*% y
[,1] |
||
a | no | 12 |
a | yes | 13 |
b | no | 1 |
b | yes | 20 |
Joseph B. Lang
Lang, J. B. (2004) Multinomial-Poisson homogeneous models for contingency tables, Annals of Statistics, 32, 340–383.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.