Description Usage Arguments Value Examples
Return a matrix of probabilities and joint probabilities of assignment for n observations and k randomization replications.
1 | createProbMatrix(assignments, byrow = F)
|
assignments |
Each column is a replication and each element is the unit's assignment. |
byrow |
Change the assignment matrix to use rows rather than columns for each randomization. |
n*k by n*k matrix of probabilities and joint probabilities of assignment to each arm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Create test matrix 1 per the PDF document.
arms1 = 1:3
# We transpose the results so that each permutation is a column.
testmat1 = t(crank::permute(arms1))
# Display the simple test matrix.
testmat1
prob_matrix = createProbMatrix(testmat1)
# RI package example, but without blocking or clustering.
y = c(8,6,2,0,3,1,1,1,2,2,0,1,0,2,2,4,1,1)
z = c(1,1,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0)
# Create 10k random permutations of the assignment vector.
perms = ri::genperms(z, maxiter=10000)
prob_matrix = createProbMatrix(perms)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.