Description Usage Arguments Value Examples
View source: R/rand-mechanisms.R
For each row of the input matrix ‘W.mat’, computes the number of units receiving each exposure.
1 | summarize.exposures(W.mat)
|
W.mat |
A matrix. Each row represents an exposure vector, so if the matrix is K x N, then K is the number of exposure vectors, and N the number of units in the population. |
A matrix with the same number of rows as ‘W.mat’, and whose number of columns is equal to the number of unique exposures in ‘W.mat’.
1 2 3 4 5 | W.mat <- rbind(c(0, 1, 1, 2, 0, 1), c(1, 1, 0, 0, 0, 0))
summarize.exposures(W.mat)
# 0 1 2
# [1,] 2 3 1
# [2,] 4 2 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.