make_tr_vec_permutation_hierarchical: Randomly assign treatment with uniform probability under a...

Description Usage Arguments Details Value References Examples

View source: R/make_tr_vec_permutation_hierarchical.R

Description

Create possible treatment random assignments with uniform probability under a two-stage hierarchical design.

Usage

1

Arguments

group

integer vector of length N of values specifying the N units' group membership (or group labels).

c

proportion of groups assigned to the high saturation (psi) in the first stage.

k

numeric vector of length 2 of proportions of individuals whithin groups assigned to treatment in the second stage, given the first stage treatment low and high saturations (phi and psi), respectively.

R

number of repetitions (treatment permutations).

seed

random number for result replicability.

Details

make_tr_vec_permutation_hierarchical produces all possible (or a random sample of all possible) treatment assignments under a two-stage hierarchical design where groups are first randomly assigned to a high or a low level of treatment saturation (psi, phi), and then units within groups are randomly assigned to treatment with probability equal to their group saturation rate. Sampling of treatment vectors is without replacement.

Value

list of R data frames each of N observations and 3 variables:

group:

Integer with group label.

group_tr:

Numeric indicator of group assignment to high saturation (psi) in the first stage.

indiv_tr:

Numeric indicator of individual assignment to treatment in the second stage.

References

Hudgens, M.G. & Halloran M.E. (2008). Toward causal inference with interference. Journal of the American Statistical Association, 103(482), 832–842.

Aronow, P.M. et al. (2020). Spillover effects in experimental data. arXiv preprint, arXiv:2001.05444.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Simulate a vector of group membership of 30 units
# equally divided into 6 groups:

group <- rep(1:6, each = 30/6)

# Define proportion of groups assigned to
# saturation psi in the first stage:

c <- 1/2

# Define proportion of individuals whithin groups assigned
# to treatment in the second stage, given the assigned
# first-stage low and high (phi, psi) saturation rates:

k <- c(2/5, 3/5)

make_tr_vec_permutation_hierarchical(group, c, k, R = 1, seed = 357)
make_tr_vec_permutation_hierarchical(group, c, k, R = 5, seed = 357)

szonszein/interference documentation built on Jan. 10, 2022, 6:35 p.m.