View source: R/binomTestEnsemble.R

binomTestEnsemble | R Documentation |

Generates lower and upper confidence interval limits for a binomial proportion using an ensemble of confidence intervals.

binomTestEnsemble(n, x, alpha = 0.05, CP = TRUE, WS = TRUE, JF = TRUE, AC = TRUE, AR = TRUE)

`n` |
sample size |

`x` |
number of successes |

`alpha` |
significance level for confidence interval |

`CP` |
logical; if |

`WS` |
logical; if |

`JF` |
logical; if |

`AC` |
logical; if |

`AR` |
logical; if |

Generates lower and upper confidence interval limits for a binomial proportions using

various sample sizes,

various numbers of successes, and

various combinations of confidence intervals.

When the `binomTestEnsemble`

function is called, it returns a two-element vector in which

the first element is the lower bound of the Ensemble confidence interval, and

the second element is the upper bound of the Ensemble confidence interval.

To construct an Ensemble confidence interval that attains an actual coverage that is close to the stated coverage, the five constituent confidence interval procedures can be combined. Since these intervals vary in width, the lower limits and the actual coverage of the constituent confidence intervals at the maximum likelihood estimator are calculated. Likewise, the upper limits and the actual coverage of the constituent confidence intervals at the maximum likelihood estimator are calculated. The centroids of the lower and upper constituent confidence intervals for points falling below and above the stated coverage are connected with a line segment. The point of intersection of these line segments and the stated coverage gives the lower and upper bound of the Ensemble confidence interval. Special cases to this approach are given in the case of (a) the actual coverages all fall above or below the stated coverage, and (b) the slope of the line connecting the centroids is infinite.

If only one of the logical arguments is `TRUE`

, the code returns a simple confidence interval of that one procedure.

The Wald confidence interval is omitted because it degenerates in actual coverage for *x = 0* and *x = n*.

Hayeon Park (hpark03@email.wm.edu), Larry Leemis (leemis@math.wm.edu)

binomTestEnsemble(10, 3) binomTestEnsemble(100, 82, CP = FALSE, AR = FALSE) binomTestEnsemble(33, 1, CP = FALSE, JF = FALSE, AC = FALSE, AR = FALSE)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.