Computing the proportion of treatment difference for stratified data. The stratification is done over time.

prop_strata(treatment, outcome, block)

Arguments

treatment

vector. The vector with treatment assignment, 0 for control and 1 for treatment group.

outcome

vector. The vector with outcome, 0 for failure and 1 for success. Must be the same length as treatment variable.

block

vector. The vector with factor level of the block. Must be same lenhth as treatment variable.

Value

the weighted mean of proportion difference (treatment - control).

Examples

set.seed(20999) prop_strata(c(0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0), c(0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1), as.factor(rep(1:3, each = 5)))
#> [1] -0.2222222