Description Usage Arguments Details Value Author(s) See Also Examples

Calculation of expected value of the width of confidence intervals in a binomial experiment, in dependence of the number of trials (number of individuals under observation), confidence level and an assumed true proportion. Available for the confidence interval methods in binCI(binGroup).

1 2 | ```
binWidth(n, p, conf.level = 0.95,
alternative = "two.sided", method = "CP")
``` |

`n` |
integer, giving the number of trials (i.e. number of individuals under observation) |

`p` |
assumed true proportion of individuals showing the trait to be estimated |

`conf.level` |
required confidence level of the interval |

`alternative` |
character string, defining the alternative hypothesis, either 'two.sided', 'less' or 'greater' where 'less' calculates the expected width between the assumed true proportion p and the upper conf.level*100 percent-bound of a one-sided CI, 'greater' calculates the expected width between the assumed true proportion p and the lower conf.level*100 percent-bound of a one-sided CI, 'two.sided' calculates the expected width between the lower and the upper bound of a two-sided conf.level*100 percent-CI. |

`method` |
character string defining the method for CI calculation:
where |

For calculation of expected interval width in the standard binomial estimation see Brown et al. (2001).

A list containing:

`expCIWidth` |
the expected value of the width of the confidence interval for the specified arguments |

and the alternative, p and n which are specified in the function call.

Frank Schaarschmidt

`binDesign`

for experimental design for hypothesis testing

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
# methods differ slightly in length when sample sizes are large:
binWidth(n=200,p=0.02,alternative="two.sided",
method="CP")$expCIWidth
binWidth(n=200,p=0.02,alternative="two.sided",
method="Blaker")$expCIWidth
binWidth(n=200,p=0.02,alternative="two.sided",
method="Score")$expCIWidth
# but do more for small sample sizes and intermediate p:
binWidth(n=20,p=0.2,alternative="two.sided",
method="CP")$expCIWidth
binWidth(n=20,p=0.2,alternative="two.sided",
method="Blaker")$expCIWidth
binWidth(n=20,p=0.2,alternative="two.sided",
method="Score")$expCIWidth
``` |

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.