simulateCoverageDifferenceTwoProportions {safestats}R Documentation

Simulate the coverage of a safe confidence sequence for differences between proportions for a given distribution and safe design.

Description

Simulate the coverage of a safe confidence sequence for differences between proportions for a given distribution and safe design.

Usage

simulateCoverageDifferenceTwoProportions(
  successProbabilityA,
  trueDelta,
  safeDesign,
  precision = 100,
  M = 1000,
  numberForSeed = NA
)

Arguments

successProbabilityA

probability of observing a success in group A.

trueDelta

difference in probability between group A and B.

safeDesign

a safe test design for two proportions retrieved through designSafeTwoProportions().

precision

precision of the grid to search over for the confidence sequence bounds. Default 100.

M

number of simulations to carry out. Default 1000.

numberForSeed

number for seed to set, default NA.

Value

the proportion of simulations where the trueDelta was included in the confidence sequence.

Examples

balancedSafeDesign <- designSafeTwoProportions(na = 1,
                                               nb = 1,
                                               nBlocksPlan = 20)
simulateCoverageDifferenceTwoProportions(successProbabilityA = 0.2,
                                         trueDelta = 0,
                                         safeDesign = balancedSafeDesign,
                                         M = 100,
                                         precision = 20,
                                         numberForSeed = 1082021)

[Package safestats version 0.8.7 Index]