Learn R Programming

blockRAR (version 1.0.2)

prop_strata: Stratified Proportion Estimate for Binomial Data

Description

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

Usage

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

Run this code
# NOT RUN {
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)))
# }

Run the code above in your browser using DataLab