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 D B A #> C 100.0 52.9 35.3 29.4 #> D 64.3 100.0 57.1 28.6 #> B 54.5 72.7 100.0 45.5 #> A 55.6 44.4 55.6 100.0