propCoin.Rd
This is like 'prop.table' for 'coin' objects.
propCoin(x, margin= 0, decimals=1)
x | 'coin' object. |
---|---|
margin | index, or vector of indices to generate margin for. |
decimals | integer indicating the number of decimal places to be used. |
Table like 'x' expressed relative to 'margin'.
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
## Random incidence matrix: 25 scenarios, 4 events. I <- matrix(rbinom(100, 1, .5), nrow = 25, ncol = 4, dimnames = list(NULL, c("A", "B", "C", "D"))) C <- coin(I, sort = TRUE) propCoin(C, 1)#> C B D A #> C 100.0 52.9 41.2 29.4 #> B 64.3 100.0 64.3 35.7 #> D 58.3 75.0 100.0 33.3 #> A 55.6 55.6 44.4 100.0