Skip to contents

Helper functions for stratified two-arm variance objectives, oracle values, Neyman allocations, regret, and rectangle vertices.

Usage

stratified_variance_objective(pi, variances, strata_share)

stratified_oracle_variance(variances, strata_share)

assign_stratified_neyman(variances, strata_share)

stratified_regret(pi, variances, strata_share)

stratified_rectangle_vertices(rectangle, strata_share, max_vertices = 65536L)

Arguments

pi

Assignment shares for each treatment/control by stratum cell. A vector should be named like "1:A" and "0:A", or a 2 x S matrix with treatment and control rows.

variances

Cell variances as a 2 x S matrix or data frame with treatment and control rows.

strata_share

Named stratum population shares that sum to one.

rectangle

Stratified variance rectangle, a list with lower and upper 2 x S matrices.

max_vertices

Maximum number of hyperrectangle vertices to enumerate.

Value

Numeric objective/regret values, named assignment vectors, or a vertex matrix. assign_stratified_neyman() returns total assignment shares over treatment/control by stratum cells.

Examples

strata_share <- c(A = 0.4, B = 0.6)
variances <- rbind(
  treatment = c(A = 0.10, B = 0.04),
  control = c(A = 0.05, B = 0.08)
)
pi <- assign_stratified_neyman(variances, strata_share)
stratified_variance_objective(pi, variances, strata_share)
#> [1] 0.2556713