Learn R Programming

LiftTest (version 0.2.0)

gen.simu.data: A Bootstrap Proportion Test for Brand Lift Testing (Liu et al., 2023)

Description

This function generates binomial random samples for the control group (with sample size \(n_1\) and success probability \(p_1\)) and the treatment group (with sample size \(n_2\) and success probability \(p_2\)).

Usage

gen.simu.data(n1, n2, p1, p2, summary=TRUE)

Value

A list of simulated data for the control group and the treatment group if summary=FALSE or a 2x2 contingency table if summary=TRUE

Arguments

n1

sample size of the control group

n2

sample size of the treatment group

p1

success probability of the control group

p2

success probability of the treatment group

summary

boolean variable. if TRUE it returns 2x2 contingency table; if FALSE it returns raw binomial random samples. By default, summary=TRUE.

Details

The a 2x2 contingency table is of the following form

col1col 2
control sample sizecontrol positive response count
treatment sample sizetreatment positive response count

Examples

Run this code
n1 <- 100; n2 <- 100; p1 <- 0.1; p2 <- 0.2
set.seed(1)
sim.data <- gen.simu.data(n1, n2, p1, p2)
sim.data

Run the code above in your browser using DataLab