prop_strata: Stratified Proportion Estimate for Binomial Data

Description Usage Arguments Value Examples

View source: R/prop_strata.R

Description

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

Usage

1
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

1
2
3
4
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)))

blockRAR documentation built on March 26, 2020, 5:52 p.m.