probabilities of assignment: Complete Random Assignment

complete_ra_probabilities(N, m = NULL, m_unit = NULL, m_each = NULL,
prob = NULL, prob_unit = NULL, prob_each = NULL, num_arms = NULL,
conditions = NULL, check_inputs = TRUE)

## Value

A matrix of probabilities of assignment

## Examples

# 2-arm designs
prob_mat <- complete_ra_probabilities(N=100)
#>      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 <- complete_ra_probabilities(N=100, m=50)
#>      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 <- complete_ra_probabilities(N=100, prob = .3)
#>      prob_0 prob_1
#> [1,]    0.7    0.3
#> [2,]    0.7    0.3
#> [3,]    0.7    0.3
#> [4,]    0.7    0.3
#> [5,]    0.7    0.3
#> [6,]    0.7    0.3
prob_mat <- complete_ra_probabilities(N=100, m_each = c(30, 70),
conditions = c("control", "treatment"))
#>      prob_control prob_treatment
#> [1,]          0.3            0.7
#> [2,]          0.3            0.7
#> [3,]          0.3            0.7
#> [4,]          0.3            0.7
#> [5,]          0.3            0.7
#> [6,]          0.3            0.7
# Multi-arm Designs
prob_mat <- complete_ra_probabilities(N=100, 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 <- complete_ra_probabilities(N=100, m_each=c(30, 30, 40))
#>      prob_T1 prob_T2 prob_T3
#> [1,]     0.3     0.3     0.4
#> [2,]     0.3     0.3     0.4
#> [3,]     0.3     0.3     0.4
#> [4,]     0.3     0.3     0.4
#> [5,]     0.3     0.3     0.4
#> [6,]     0.3     0.3     0.4
prob_mat <- complete_ra_probabilities(N=100, m_each=c(30, 30, 40),
conditions=c("control", "placebo", "treatment"))
#>      prob_control prob_placebo prob_treatment
#> [1,]          0.3          0.3            0.4
#> [2,]          0.3          0.3            0.4
#> [3,]          0.3          0.3            0.4
#> [4,]          0.3          0.3            0.4
#> [5,]          0.3          0.3            0.4
#> [6,]          0.3          0.3            0.4
prob_mat <- complete_ra_probabilities(N=100, 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 <- complete_ra_probabilities(N=100, prob_each = c(.2, .7, .1))