View source: R/obtain_permutation_probabilities.R
obtain_permutation_probabilities | R Documentation |
Obtain the probabilities of permutations
obtain_permutation_probabilities(declaration)
declaration |
A random assignment declaration, created by |
a vector of probabilities
declaration <- declare_ra(N = 5, prob_each = c(.49, .51))
obtain_num_permutations(declaration)
perm_probs <- obtain_permutation_probabilities(declaration)
perms <- obtain_permutation_matrix(declaration)
# probabilities of assignment from declaration *should* match the average over all permutations
true_probabilities <- declaration$probabilities_matrix[,2]
true_probabilities
# correctly WRONG because the perms have different probs!
rowMeans(perms)
# correctly correct!
perms %*% perm_probs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.