probabilities of assignment: Cluster Random Assignment

cluster_ra_probabilities(clusters = NULL, m = NULL, m_unit = NULL,
m_each = NULL, prob = NULL, prob_unit = NULL, prob_each = NULL,
num_arms = NULL, conditions = NULL, simple = FALSE,
check_inputs = TRUE)

## Value

A matrix of probabilities of assignment

## Examples


# Two Group Designs
clusters <- rep(letters, times = 1:26)
prob_mat <- cluster_ra_probabilities(clusters = clusters)
#>      prob_0 prob_1
#> [1,]    0.5    0.5
#> [2,]    0.5    0.5
#> [3,]    0.5    0.5
#> [4,]    0.5    0.5
#> [5,]    0.5    0.5
#> [6,]    0.5    0.5
prob_mat <- cluster_ra_probabilities(clusters = clusters, m = 10)
#>         prob_0    prob_1
#> [1,] 0.6153846 0.3846154
#> [2,] 0.6153846 0.3846154
#> [3,] 0.6153846 0.3846154
#> [4,] 0.6153846 0.3846154
#> [5,] 0.6153846 0.3846154
#> [6,] 0.6153846 0.3846154
prob_mat <- cluster_ra_probabilities(clusters = clusters,
m_each = c(9, 17),
conditions = c("control", "treatment"))

# Multi-arm Designs
prob_mat <- cluster_ra_probabilities(clusters = clusters, num_arms = 3)
#>        prob_T1   prob_T2   prob_T3
#> [1,] 0.3333333 0.3333333 0.3333333
#> [2,] 0.3333333 0.3333333 0.3333333
#> [3,] 0.3333333 0.3333333 0.3333333
#> [4,] 0.3333333 0.3333333 0.3333333
#> [5,] 0.3333333 0.3333333 0.3333333
#> [6,] 0.3333333 0.3333333 0.3333333
prob_mat <- cluster_ra_probabilities(clusters = clusters, m_each = c(7, 7, 12))
#>        prob_T1   prob_T2   prob_T3
#> [1,] 0.2692308 0.2692308 0.4615385
#> [2,] 0.2692308 0.2692308 0.4615385
#> [3,] 0.2692308 0.2692308 0.4615385
#> [4,] 0.2692308 0.2692308 0.4615385
#> [5,] 0.2692308 0.2692308 0.4615385
#> [6,] 0.2692308 0.2692308 0.4615385
prob_mat <- cluster_ra_probabilities(clusters = clusters, m_each = c(7, 7, 12),
conditions=c("control", "placebo", "treatment"))
#>      prob_control prob_placebo prob_treatment
#> [1,]    0.2692308    0.2692308      0.4615385
#> [2,]    0.2692308    0.2692308      0.4615385
#> [3,]    0.2692308    0.2692308      0.4615385
#> [4,]    0.2692308    0.2692308      0.4615385
#> [5,]    0.2692308    0.2692308      0.4615385
#> [6,]    0.2692308    0.2692308      0.4615385
prob_mat <- cluster_ra_probabilities(clusters = clusters,
conditions=c("control", "placebo", "treatment"))
#>      prob_control prob_placebo prob_treatment
#> [1,]    0.3333333    0.3333333      0.3333333
#> [2,]    0.3333333    0.3333333      0.3333333
#> [3,]    0.3333333    0.3333333      0.3333333
#> [4,]    0.3333333    0.3333333      0.3333333
#> [5,]    0.3333333    0.3333333      0.3333333
#> [6,]    0.3333333    0.3333333      0.3333333
prob_mat <- cluster_ra_probabilities(clusters = clusters,
prob_each = c(.1, .2, .7))