simScenProductTwoPrevs: Simulation scenario for the product of two prevlaence...

Description Usage Arguments Value Examples

View source: R/simulations.R

Description

This is a simulation to compute the coverage of the confidence interval returned by bootComb() in the case of the product of 2 probability parameter estimates.

Usage

1
simScenProductTwoPrevs(B = 1000, p1, p2, nExp1, nExp2, alpha = 0.05)

Arguments

B

The number of simulations to run. Defaults to 1e3.

p1

The true value of the first probability parameter.

p2

The true value of the second probability parameter.

nExp1

The size of each simulated experiment to estimate p1.

nExp2

TThe size of each simulated experiment to estimate p2.

alpha

The confidence level; i.e. the desired coverage is 1-alpha. Defaults to 0.05.

Value

A list with 2 elements:

estimate

A single number, the proportion of simulations for which the confidence interval contained the true parameter value.

conf.int

A 95% confidence interval for the coverage estimate.

Examples

1
2
3
4
simScenProductTwoPrevs(p1=0.35,p2=0.2,nExp1=100,nExp2=1000,B=100)
  # B value only for convenience here
  # Increase B to 1e3 or 1e4 (be aware this may run for some time).
 

bootComb documentation built on Nov. 19, 2020, 1:07 a.m.